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

Session Tracking in Servlets

02/10/2016 Categories: Servlets. No Comments on Session Tracking in Servlets

A session is a collection of HTTP requests, over a period of time, between a client and server. Maintaining the data within the session is known as session tracking. For example, maintaining the book details added to the cart in an online book shop application. Session tracking mechanisms include the following: URL rewriting (query strings) […]

Read the rest of this entry »

Retrieving Parameters in Servlets

02/10/2016 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

02/10/2016 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:

  Initialization parameters are stored as key value pairs. They are […]

Read the rest of this entry »

Creating and Executing a Servlet Manually

02/10/2016 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

02/10/2016 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

02/10/2016 Categories: Servlets. No Comments on Life Cycle of a Servlet

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 class in the […]

Read the rest of this entry »
Scroll Up