|
DLESE Tools v1.6.0 |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.dlese.dpc.webapps.servlets.filters.FilterCore
public abstract class FilterCore
Abstract class that contains core methods common to Servlet Filters. Implementation note: Servlet Filters only get instatiated once and live for the lifetime of the application.
Constructor Summary | |
---|---|
FilterCore()
|
Method Summary | |
---|---|
protected static String |
getDateStamp()
Return a string for the current time and date, sutiable for display in log files and output to standout: |
protected boolean |
handleErrorCodes(HttpServletResponse res,
CharArrayWrapper wrapper)
Handles http errors (not yet implemented). |
static boolean |
isGzipSupported(HttpServletRequest req)
Determines whether the client that made the request can accept a gzip response. |
protected void |
prtlnCore(String s)
Output a line of text to standard out, with datestamp, if debug is set to true. |
protected void |
writeGzipResponse(char[] content,
HttpServletResponse res)
Writes the response content to the client using gzip compression. |
protected void |
writeRegularResponse(StringBuffer content,
HttpServletResponse res)
Writes the response to the OutputStream without gzipping it, for use if the client can not accept a gzip response. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface javax.servlet.Filter |
---|
destroy, doFilter, init |
Constructor Detail |
---|
public FilterCore()
Method Detail |
---|
protected final void writeGzipResponse(char[] content, HttpServletResponse res) throws IOException
isGzipSupported(javax.servlet.http.HttpServletRequest)
method.
Note: you must set the content encoding type to gzip using the method
response.setHeader("Content-Encoding", "gzip");
prior to calling chain.doFilter()
method.
content
- The content to sent to the client in gzip formatres
- The response object
IOException
- If IO Error occursprotected final void writeRegularResponse(StringBuffer content, HttpServletResponse res) throws IOException
content
- The content to setdres
- The response
IOException
- If errorpublic static final boolean isGzipSupported(HttpServletRequest req)
req
- The request
protected final boolean handleErrorCodes(HttpServletResponse res, CharArrayWrapper wrapper) throws IOException
res
- The responsewrapper
- The wrapper
IOException
- If error processingprotected static final String getDateStamp()
protected final void prtlnCore(String s)
s
- The String that will be output.
|
DLESE Tools v1.6.0 |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |