Tuesday 28 February 2017

servlet tutorial

sendRedirect


The sendRedirect() method of HttpServletResponse interface can be used to redirect response to another resource, it may be servlet, jsp or html file. It accepts relative as well as absolute URL.

servletConfig


An object of ServletConfig is created by the web container for each servlet. This object can be used to get configuration information from web.xml file.

servletContext


An object of ServletContext is created by the web container at time of deploying the project. This object can be used to get configuration information from web.xml file. There is only one ServletContext object per web application.

servletAttribute


An attribute in servlet is an object that can be set, get or removed from one of the following scopes:
1-request scope
2-session scope
3-application scope

cookie part1


A cookie is a small piece of information that is persisted between the multiple client requests. A cookie has a name, a single value, and optional attributes such as a comment, path and domain qualifiers, a maximum age, and a version number.

cookie part2 eclipse example


A cookie is a small piece of information that is persisted between the multiple client requests. A cookie has a name, a single value, and optional attributes such as a comment, path and domain qualifiers, a maximum age, and a version number.

login logout using cookie


A cookie is a kind of information that is stored at client side. In the previous page, we learned a lot about cookie e.g. how to create cookie, how to delete cookie, how to get cookie etc. Here, we are going to create a login and logout example using servlet cookies. In this example, we are creating 3 links: login, logout and profile. User can't go to profile page until he/she is logged in. If user is logged out, he need to login again to visit profile.

urlRewriter


In URL rewriting, we append a token or identifier to the URL of the next Servlet or the next resource. We can send parameter name/value pairs using the following format:
url?name1=value1&name2=value2&??

httpSession


container creates a session id for each user.The container uses this id to identify the particular user.An object of HttpSession can be used to perform two tasks:
1-bind objects
2-view and manipulate information about a session, such as the session identifier, creation time, and last accessed time.

Saturday 25 February 2017

Servlet Request



An object of ServletRequest is used to provide the client request information to a servlet such as content type, content length, parameter names and values, header informations, attributes etc.

Friday 24 February 2017

RequestDispatcher


The RequestDispatcher interface provides the facility of dispatching the request to another
resource it may be html, servlet or jsp. This interface can also be used to include the content of another resource also. It is one of the way of servlet collaboration.

Wednesday 22 February 2017

Http Servlet

Http Servlet


In this video tutorial i demonstrate the httpserverl step by step .httpservlet is a latest way to create your servlet in httpservlet there is more functionality add compare to Gengeric servlet and servlet interface.More video

Genric Servlet

Generic Servlet


In this video tutorial i demonstrate the generic servlet step by step. More video 

Servlet Tutorials

First Servlet Demo

         

There are three ways to create your servlet 1-Servlet interface 2-Generic Servlet 3-HttpServlet

In this video tutorials i am using the Servlet interface
for creating the servlet step by step.