|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object javax.servlet.GenericServlet javax.servlet.http.HttpServlet com.groiss.servlet.Dispatcher
public class Dispatcher
This servlet calls methods via reflection.
Field Summary | |
---|---|
static int |
licenceStatus
|
static com.groiss.servlet.impl.OldRequestHandler |
oldHandler
|
Constructor Summary | |
---|---|
Dispatcher()
|
Method Summary | |
---|---|
static void |
addModificationInfo(javax.servlet.http.HttpServletRequest req,
javax.servlet.http.HttpServletResponse resp,
long lastModified,
java.util.Locale locale)
adds some header fields to the response so we can determine modification on the next request adds an ETag and a Last-Modified -Header |
static java.util.Locale |
getBrowserLocale(javax.servlet.http.HttpServletRequest req)
Read the locale from the browser. |
static java.lang.String |
getContextPath()
Returns the context path of this application. |
static java.lang.reflect.Method |
getMethod(java.lang.String m)
Return the method from a string containing the class and method name, syntax: classname "." methodname |
static long |
getRequestCount()
Get the request count for statistics. |
void |
init()
|
static boolean |
isModifiedSince(javax.servlet.http.HttpServletRequest req,
javax.servlet.http.HttpServletResponse resp,
long lastModified,
java.util.Locale l)
returns true if the requested resource has been modified since the last request the following methods are used: check the ETag -header
check the if-modified-since - header
|
static void |
reloadClasses()
Reload the method cache the Dispatcher holds. |
void |
service(javax.servlet.http.HttpServletRequest req,
javax.servlet.http.HttpServletResponse res)
|
static void |
setExpiresImmediatelyForGuest(javax.servlet.http.HttpServletRequest req,
javax.servlet.http.HttpServletResponse res)
if no user is currently logged in, it's required, that some resources are not cached, so the user gets the new files as soon he loggs in |
static java.util.Locale |
setLocale(javax.servlet.http.HttpServletRequest req)
Set the locale to the ThreadContext. |
void |
setPathInfo(java.lang.String pi)
Deprecated. use MultipartRequest.setPathInfo(String) instead, will be removed in @ep90 |
static void |
writeToResp(javax.servlet.http.HttpServletResponse res,
java.lang.String pageStr)
|
Methods inherited from class javax.servlet.http.HttpServlet |
---|
doDelete, doGet, doHead, doOptions, doPost, doPut, doTrace, getLastModified, service |
Methods inherited from class javax.servlet.GenericServlet |
---|
destroy, getInitParameter, getInitParameterNames, getServletConfig, getServletContext, getServletInfo, getServletName, init, log, log |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static com.groiss.servlet.impl.OldRequestHandler oldHandler
public static int licenceStatus
Constructor Detail |
---|
public Dispatcher()
Method Detail |
---|
public void init()
init
in class javax.servlet.GenericServlet
@Deprecated public void setPathInfo(java.lang.String pi)
MultipartRequest.setPathInfo(String)
instead, will be removed in @ep90
pi
- s string defining the method to call in form classname "." methodnamepublic void service(javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse res) throws java.io.IOException, java.io.UnsupportedEncodingException
service
in class javax.servlet.http.HttpServlet
java.io.IOException
java.io.UnsupportedEncodingException
public static void writeToResp(javax.servlet.http.HttpServletResponse res, java.lang.String pageStr) throws java.lang.Exception
java.lang.Exception
public static long getRequestCount()
public static java.lang.reflect.Method getMethod(java.lang.String m) throws java.lang.Exception
m
-
java.lang.Exception
- an exception is thrown if the string describes not a method with the signature necessary for the dispatcher.public static void reloadClasses()
public static java.util.Locale setLocale(javax.servlet.http.HttpServletRequest req)
public static java.util.Locale getBrowserLocale(javax.servlet.http.HttpServletRequest req)
public static java.lang.String getContextPath()
public static void addModificationInfo(javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse resp, long lastModified, java.util.Locale locale)
ETag
and a Last-Modified
-Header
req
- requestresp
- responselastModified
- last modification timestamplocale
- the current localepublic static boolean isModifiedSince(javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse resp, long lastModified, java.util.Locale l)
true
if the requested resource has been modified since the last request ETag
-headerif-modified-since
- header
req
- requestresp
- responselastModified
- last modification timestampl
- the current locale
true
if the resource has been modified since the the last request, false
otherwisepublic static void setExpiresImmediatelyForGuest(javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse res)
req
- res
-
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |