• Java advantage: no memory access violations, strong typing violations. (Servlet will not crash
servers.)
• Security Manager. Only trusted servlets will be allow to access network services or local files.
• Support fine grained access control (more secure than MS. ActiveX.)
Performance::
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:
Provides a set of classes and interfaces that describe and defined the
contract between the servlet class and the runtime environment provided by
the servlet container. Following are the interfaces available in this package:
Provides a set of classes and interfaces that describe and define the
contract between the servlet class running under the HTTP protocol
and the runtime environment provided by the servlet
container. HttpServlet class implements the Servlet interface.
void destroy()
ServletConfig getServletConfig()
String getServletInfo()
javax.servlet.ServletConfig
Interface
HttpServletRequest Interface
The HttpServletRequest interface is a subtype
of ServletRequest interface. Implementation for this interface is
provided by the servlet container. The HttpServletRequest interface
object allows us to access the data available in the HTTP headers and
HTTP requests. Following methods helps us to access the header
information:
String getHeader(String)
Enumeration getHeaders(String)
Enumeration getHeaderNames()
String getContextPath()
String getServletPath()
String getPathInfo()
String getRequestURI()
HttpServletResponse Interface
Following table shows some of the header fields and the description of
their value:
Other methods provided by this interface are:
sendError(int)
sendError(int, String)
sendRedirect(String URL)
https://www.startertutorials.com/ajwt/week-1-lab-exercise.html