Advanced Java and Web Technologies for JNTUK
Blog providing beginner tutorials on different web technologies like HTML, CSS, Javascript, PHP, MYSQL, XML, Java Beans, Servlets, JSP and AJAX
Subscribe to Startertutorials.com's YouTube channel for different tutorial and lecture videos.

Retrieving Parameters in Servlets

Categories: Servlets. No Comments on Retrieving Parameters in Servlets

It is common in web applications to pass data or parameters from one to another page. To retrieve the values of various elements in a HTML form or from another page, we can use the following methods which are available in HttpServletRequest object: String getParameter(String  name) Enumeration getParameterNames() String[] getParamterValues(String  name)   Following example demonstrates […]

Read the rest of this entry »

Initialization Parameters in Servlets

Categories: Servlets. No Comments on Initialization Parameters in Servlets

Most of the time, data (Ex: admin email, database username and password, user roles etc…) need to be provided in the production mode (client choice). Initialization parameters can reduce the complexity and maintenance. Initialization parameters are specified in the web.xml file as follows: <servlet> <servlet-name>Name of servlet</servlet-name> <servlet-class>Servlet class</servlet-class> <init-param> <param-name>Mail</param-name> <param-value>[email protected]</param-value> </init-param> </servlet>   […]

Read the rest of this entry »

Creating and Executing a Servlet Manually

Categories: Servlets. No Comments on Creating and Executing a Servlet Manually

Here we will learn how to create and execute a servlet manually i.e., without using any IDEs. For developing web applications using servlets you need a application server like Apache Tomcat, and a text editor like notepad.   Video: Apache Tomcat Installation   A servlet is a normal java class which follows these set of rules: […]

Read the rest of this entry »

Servlet API

Categories: Servlets. No Comments on Servlet API

Servlet API is a set of classes and interfaces that specify a contract between a servlet class and a servlet container. Some examples of servers that provide servlet containers are: Apache Tomcat, Oracle’s WebLogic, IBM’s Websphere, JBoss etc. All the API classes and interfaces are grouped into following packages: javax.servlet javax.servlet.http   javax.servlet Package   […]

Read the rest of this entry »

Life Cycle of a Servlet

Categories: Servlets. No Comments on Life Cycle of a Servlet

Introduction   Life cycle of a servlet contains the following stages: Instantiation Initialization Servicing Destruction   Following figure illustrates the life cycle of a servlet:     Instantiation   In this stage the servlet container searches the web.xml file for servlet. If the servlet is found, it will create an object for the corresponding servlet […]

Read the rest of this entry »