|
![]() |
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjavax.servlet.GenericServlet
sunlabs.brazil.servlet.BrazilServlet (view source)
public final class BrazilServlet
This is the Brazil Toolkit Servlet Adapter. It allows one to run
applications built with the Brazil Toolkit in any web server that
provides a Servlet
container that implements the Servlet
2.2 API.
The servlet should be installed as a web application as specified in
the Java Servlet Specification, v2.2. The servlet deployment
descriptor should create a configuration that causes the request path
to consist of only the context path and pathInfo elements. There
should not be a servlet path element. See section 5 of the
specification for more details (note that the definitions of each path
element are are more accurately stated in the 2.3 specification). The
deployment descriptor should be similar to the following:
The default configuration file for the Brazil application is loaded
from the system resource
<web-app>
<display-name>BrazilServlet servlet container for Brazil</display-name>
<description>
This servlet wraps the Brazil Toolkit so it can run within
any web server environment that supports the 2.2 Servlet API
</description>
<servlet>
<servlet-name>BrazilServlet</servlet-name>
<servlet-class>sunlabs.brazil.servlet.BrazilServlet</servlet-class>
<init-param>
<param-name>config</param-name>
<param-value>configA|configB</param-value>
</init-param>
</servlet>
<servlet-mapping>
<servlet-name>BrazilServlet</servlet-name>
<url-pattern>/*</url-pattern>
</servlet-mapping>
</web-app>
/sunlabs/brazil/server/config
.
Additional configuration files, which may override properties in the
default file, are searched by looking at the "|" separated list of
file names associated with config
servlet parameter.
File names that are not "absolute" are located relative to the
servlet context root If no config
servlet parameter
is defined, the file named "config" (if any) in the servlet context
root is used.
The Brazil root
property if obtained from the "root"
servlet parameter. If none is provided, the "root" property from
the configuration files (last one wins) is used. As before, relative
root directories are resolved with respect to the servlet context
root.
The following properties are set by this class:
url.servlet
context_path
servlet_name
servlet_container
BServletSocket
,
BServletServerSocket
,
BServletRequest
,
Serialized FormConstructor Summary | |
---|---|
BrazilServlet()
|
Method Summary | |
---|---|
void |
destroy()
Called by the servlet container to indicate to a servlet that the servlet is being taken out of service. |
void |
init(ServletConfig config)
Called by the servlet container to place the servlet into service. |
void |
service(ServletRequest req,
ServletResponse res)
Called by the servlet container to allow the servlet to respond to a request. |
Methods inherited from class javax.servlet.GenericServlet |
---|
getInitParameter, getInitParameterNames, getServletConfig, getServletContext, getServletInfo, getServletName, init, log, log |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public BrazilServlet()
Method Detail |
---|
public void init(ServletConfig config) throws ServletException
init
in interface Servlet
init
in class GenericServlet
config
- the ServletConfig
object
that contains configuration
information for this servlet
ServletException
- if an exception occurs that
interrupts the servlet's normal
operationServlet.init(javax.servlet.ServletConfig)
public void service(ServletRequest req, ServletResponse res) throws ServletException, IOException
This method implements the abstract method declared in the
GenericServlet
super class.
service
in interface Servlet
service
in class GenericServlet
req
- the ServletRequest
object
that contains the client's requestres
- the ServletResponse
object
that will contain the servlet's response
ServletException
- if an exception occurs that
interferes with the servlet's
normal operation occurred
IOException
- if an input or output
exception occursServlet.service(javax.servlet.ServletRequest, javax.servlet.ServletResponse)
public void destroy()
destroy
in interface Servlet
destroy
in class GenericServlet
Servlet.destroy()
|
Version Kenai-svn-r24, Generated 08/18/09 Copyright (c) 2001-2009, Sun Microsystems. |
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |