Tag: servlets
What is servlet? An Introduction to Java Servlets
The basic aim of servlet is to develop web applications. Before servlets came into picture there was a specification called CGI. Servlets specification developed by SUN and released to the industry. Lot of server vendors came forward for implementing…
Steps to Write Java Servlet Program
Let us see the basic steps to develop java servlet application… Servlet program is not like, writing java code and execute through command prompt. We need to follow the following steps in order to develop any servlets program. Even…
How to Write Deployment Descriptor,web.xml In Servlet
This web.xml is like index of book, web.xml is containing details of static web resource programs and dynamic web resource programs. The purpose of web.xml is to hide to achieve the security for the web application by not…
How to Set Classpath For Servlet,setting Classpath For servlet-api.jar
As i told you in the previous article, we should set servlet-api.jar in our class path, in order to work with servlet applications. We cannot run servlet applications if you didn’t set servlet-api.jar. Where Can You Download servlet-api.jar You…
Servlet Hello World Example in Eclipse IDE with Tomcat Server
We will see the first servlet application directly in Eclipse IDE and i am using Tomcat 7, friends doing java servlet with out eclipse is really tedious 😉 we cannot do every thing individually and copying related files into…
Servlet Life Cycle in Java, Explanation of Servlet Life Cycle Methods
Aware of servlet life cycle is very important, before you going to execute first application. So let us see flow of life cycle methods… Java servlet will be executed in different stages, of which Loading the application and its…
Example on Servlet Life Cycle in Java
Let us see one example on servlet life cycle. Do you have any doubts related to the concept ? if so please check this Servlet Life Cycle theory article before you execute this example. Files required ServletLifeCycle.java web.xml Directory…
Example on getParameterNames() method of Servlet Request Object
So far we have worked on getParameter(), let us see how to use getParameterNames() method. With getParameter() we are able to find parameter values by passing parameter name, just like.. In html: <input type=”text” name=”n1″> In Java: String val=req.getParameter(“n1”);…
Example of ServletContext in Java
ServletContext is one of pre-defined interface available in javax.servlet.*; Object of ServletContext interface is available one per web application. An object of ServletContext is automatically created by the container when the web application is deployed. Assume there exist a…