public class Dispatcher extends javax.servlet.http.HttpServlet implements Public
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
ADMIN_SESSION |
static java.lang.String |
ADMIN_URL |
static int |
licenceStatus |
static com.groiss.servlet.impl.OldRequestHandler |
oldHandler |
Constructor and Description |
---|
Dispatcher() |
Modifier and Type | Method and Description |
---|---|
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 void |
addModificationInfo(javax.servlet.http.HttpServletRequest req,
javax.servlet.http.HttpServletResponse resp,
long lastModified,
java.util.Locale locale,
java.lang.String ctx)
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 void |
checkAdminSession(javax.servlet.http.HttpServletRequest req)
check if the session is an admin session and throw exception
|
static Access.mode |
getAccessAnnotation(java.lang.reflect.Method m) |
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 java.lang.Boolean |
isAdminConnector(javax.servlet.http.HttpServletRequest req)
This method return TRUE if admin port or address is specified and the request uses this connector.
|
static boolean |
isAdminSession(javax.servlet.http.HttpServletRequest req)
check if the session is an admin session
|
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 boolean |
isModifiedSince(javax.servlet.http.HttpServletRequest req,
javax.servlet.http.HttpServletResponse resp,
long lastModified,
java.util.Locale l,
java.lang.String ctx)
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 boolean |
refererOK(javax.servlet.http.HttpServletRequest req,
java.lang.String methodStr,
java.lang.Class<?> clazz) |
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)
this method is for compatibility issues
|
static java.util.Locale |
setLocale(javax.servlet.http.HttpServletRequest req,
java.security.Principal u)
Set the thredcontext Locale and return it.
1) from session 2) the browser locale is used if useBrowserlocale is set
else user locale 3) from cookie 4) default from configuration
if userlocale is null the default locale is used
|
static void |
writeHeaders(javax.servlet.http.HttpServletResponse res,
Page page) |
static void |
writeToResp(javax.servlet.http.HttpServletResponse res,
Page page) |
static void |
writeToResp(javax.servlet.http.HttpServletResponse res,
java.lang.String pageStr)
Write a string to the response.
|
doDelete, doGet, doHead, doOptions, doPost, doPut, doTrace, getLastModified, service
public static com.groiss.servlet.impl.OldRequestHandler oldHandler
public static int licenceStatus
public static java.lang.String ADMIN_SESSION
public static java.lang.String ADMIN_URL
public void init()
init
in class javax.servlet.GenericServlet
public 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 writeHeaders(javax.servlet.http.HttpServletResponse res, Page page)
public static void writeToResp(javax.servlet.http.HttpServletResponse res, java.lang.String pageStr)
public static void writeToResp(javax.servlet.http.HttpServletResponse res, Page page)
public static long getRequestCount()
public static Access.mode getAccessAnnotation(java.lang.reflect.Method m)
public static boolean isAdminSession(javax.servlet.http.HttpServletRequest req)
public static java.lang.Boolean isAdminConnector(javax.servlet.http.HttpServletRequest req)
public static void checkAdminSession(javax.servlet.http.HttpServletRequest req)
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 setLocale(javax.servlet.http.HttpServletRequest req, java.security.Principal u)
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
-Headerreq
- requestresp
- responselastModified
- last modification timestamplocale
- the current localepublic static void addModificationInfo(javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse resp, long lastModified, java.util.Locale locale, java.lang.String ctx)
ETag
and a Last-Modified
-Headerreq
- 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
- headerreq
- requestresp
- responselastModified
- last modification timestampl
- the current localetrue
if the resource has been modified since the the last request, false
otherwisepublic static boolean isModifiedSince(javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse resp, long lastModified, java.util.Locale l, java.lang.String ctx)
true
if the requested resource has been modified since the last request ETag
-headerif-modified-since
- headerreq
- requestresp
- responselastModified
- last modification timestampl
- the current localectx
- an optional context-string to be appended to the etagtrue
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
- public static boolean refererOK(javax.servlet.http.HttpServletRequest req, java.lang.String methodStr, java.lang.Class<?> clazz) throws java.lang.Exception
java.lang.Exception
@enterprise 9.0.33982 Copyright © 2001-2023 Groiss Informatics GmbH. All Rights Reserved.