|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjavax.servlet.GenericServlet
javax.servlet.http.HttpServlet
com.eaio.j2ee.www.redirector.ReDirector
A servlet that redirects users based on data from an XML file. The file should have the following structure:
<links> ... <link> <id>Link id</id> <href>Link URL</href> </link> ... <links>
Invoke the servlet with t
as the parameter containing the key,
for example:
servlet?t=RAH
The t parameter is not case sensitive.
The servlets needs an init parameter called "links" that specifies where to find the XML file containing the links.
CHANGES:
Field Summary | |
static java.lang.String |
PARAMETER_HOSTNAME
The "hostname" parameter name. |
static java.lang.String |
PARAMETER_INTERVAL
The "interval" parameter name. |
static java.lang.String |
PARAMETER_LINKS
The "links" parameter name. |
(package private) static long |
serialVersionUID
The serial version UID. |
Constructor Summary | |
ReDirector()
No-argument constructor. |
Method Summary | |
void |
destroy()
Clears pointers to fields. |
void |
doGet(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
Forwards requests to either external URLs or internal pages. |
void |
doPost(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
Forwards request to either external URLs or internal pages. |
long |
getLastModified(javax.servlet.http.HttpServletRequest request)
Return the time the servlet reloaded the XML file last time. |
java.lang.String |
getServletInfo()
Return servlet information. |
void |
init(javax.servlet.ServletConfig config)
Initializes the servlet. |
Methods inherited from class javax.servlet.http.HttpServlet |
doDelete, doHead, doOptions, doPut, doTrace, service, service, service |
Methods inherited from class javax.servlet.GenericServlet |
getInitParameter, getInitParameterNames, getServletConfig, getServletContext, getServletName, init, log, log |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
static final long serialVersionUID
public static final java.lang.String PARAMETER_HOSTNAME
public static final java.lang.String PARAMETER_INTERVAL
public static final java.lang.String PARAMETER_LINKS
Constructor Detail |
public ReDirector()
Method Detail |
public void init(javax.servlet.ServletConfig config) throws javax.servlet.ServletException
config
- the Servlet's configuration
javax.servlet.ServletException
public void destroy()
public void doGet(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) throws javax.servlet.ServletException, java.io.IOException
request
- the requestresponse
- the response
javax.servlet.ServletException
java.io.IOException
public void doPost(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) throws javax.servlet.ServletException, java.io.IOException
request
- the requestresponse
- the response
javax.servlet.ServletException
java.io.IOException
public java.lang.String getServletInfo()
public long getLastModified(javax.servlet.http.HttpServletRequest request)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |