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

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



Interfaces:
Filter : A filter is an object that performs filtering tasks on either the request to a resource (a servlet or static content), or on the response from a resource, or both.

FilterChain : A FilterChain is an object provided by the servlet container to the developer giving a view into the invocation chain of a filtered request for a resource.

FilterConfig : A filter configuration object used by a servlet container to pass information to a filter during initialization.

Servlet : Defines methods that all servlets must implement.

ServletConfig : A servlet configuration object used by a servlet container to pass information to a servlet during initialization.

ServletContext : Defines a set of methods that a servlet uses to communicate with its servlet container, for example, to get the MIME type of a file, dispatch requests, or write to a log file.

ServletRequest : Defines an object to provide client request information to a servlet.

ServletResponse : Defines an object to assist a servlet in sending a response to the client.

SingleThreadModel(deprecated) : As of Java Servlet API 2.4, with no direct replacement.

RequestDispatcher : Defines an object that receives requests from the client and sends them to any resource (such as a servlet, HTML file, or JSP file) on the server.

Classes:
GenericServlet : Defines a generic, protocol-independent servlet.

ServletInputStream : Provides an input stream for reading binary data from a client request, including an efficient readLine method for reading data one line at a time.

ServletOutputStream : Provides an output stream for sending binary data to the client.

ServletException : Defines a general exception a servlet can throw when it encounters difficulty.


Methods of Servlet Interface:
public void init(ServletConfig g)
public void service(ServletRequest request,ServletResponse response)
public void destroy()
public ServletConfig getServletConfig()
public String getServletInfo()


Methods of ServletConfig:
public String getInitParameters(String name)
public Enumeration getInitParametersNames()
public servletContext getServletContext()


Methods of ServletRequest:
public void setAttributes(String name,Object value)
public void getattributes(String name)
public string getParameter(String name)
public Enumeration getParametersNames()
public int getContextLength()
public InputStream getInputStream()
public int getLocalPort()
public int getRemotePort()
public int getserverPort()
public void getrequestDispatcher(String url)


Methods of ServletResponse:
public int getBufferSize()
public void setContentType(String s)
public OutputStream getOutputstream()
public PrintWriter getWriter()

Methods of ServletContext:
public string getInitParameters(string name)
public Enumeration getInitParametersNames()
public void setAttributes(string name,Object value)
public Object getAttributes()

More Servlet Topics :

No comments: