Java Package javax.servlet.http (Interfaces,Classes and Methods)

javax.servlet.http
The javax.servlet.http package contains a number of classes and interfaces that describe and define the contracts between a servlet class running under the HTTP protocol and the runtime environment provided for an instance of such a class by a conforming servlet container.



Interfaces:
HttpServletRequest : Extends the ServletRequest interface to provide request information for HTTP servlets.

HttpServletResponse : Extends the ServletResponse interface to provide HTTP-specific functionality in sending a response.

HttpSession : Provides a way to identify a user across more than one page request or visit to a Web site and to store information about that user.

Classes:
Cookie : Creates a cookie, a small amount of information sent by a servlet to a Web browser, saved by the browser, and later sent back to the server.

HttpServlet : Provides an abstract class to be subclassed to create an HTTP servlet suitable for a Web site.


Methods of HttpServletRequest:
public cookie[] getCookies()
public string getHeaders(String Name)
public HttpSession getSession()

Methods of HttpServletResponse:
public void addcookie(String name,String value)
public void addHeaders(String name,String value)
public void sendRedirect(String url)

Methods of HttpSession:
public void setAttribute(String name,Object value)
public Object getAttribute(String name)

Methods of Httpservlet:
public void service(HttpServletRequest,HttpServletResponse)
throws ServletException,IOException
public void doGet(HttpServletRequest,HttpServletResponse)
throws ServletException,IOException
public void doPost(HttpServletRequest,HttpServletResponse)
throws ServletException,IOException


More Servlet Topics :

No comments: