Append data text file servlet

Last updated on April 20th, 2022 at 09:36 amIt is very easy to write content to a text file that is already have some amount of data using Java. All you have to do is add a boolean true like below. This is tested in Tomcat 10. This code will create a file with the […]

How to get a response from one servlet to another

Last updated on April 20th, 2022 at 10:28 amThere are some scenarios where we need to forward request to another Servlet and include their response in the main servlet. Sending response from one servlet to another was never easy just follow the script below. For example if we have 2 Servlet, One is named as […]

Get The Real Path Of A Servlet

Last updated on November 17th, 2015 at 05:13 amSometimes programmers need to write a JSP or Servlet code that will save a text file to a particular path, Execute a shell / perl script etc., for this we need to find the real path in which our JSP or Servlet is running. This will help […]

Java Servlet create cookie example

Last updated on May 5th, 2016 at 01:59 amJava Servlet create cookie example, Just a straight forward and simple example on using Servlet to create a cookie and read it.. All you have to do is copy the below script and Name it as HttpCookie.java, Modify the code according to your needs. Now compile the […]