|
PAJES 2.3.9 | |||||||||
| 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
org.pajes.servlet.PajeServlet
org.pajes.servlet.StaticPajeServlet
Abstract super-class of classes that return static content that the web server would not usually have access to (for example, static content located within a JAR in the /WEB-INF/lib directory).
| Constructor Summary | |
protected |
StaticPajeServlet()
Creates a new StaticPajeServlet. |
protected |
StaticPajeServlet(java.lang.String contentType)
Creates a new StaticPajeServlet. |
| Method Summary | |
protected void |
doGet(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
Sends the requested static content to the browser. |
protected abstract byte[] |
getContent(javax.servlet.http.HttpServletRequest request)
Retrieves the static content to be returned to a request. |
protected java.lang.String |
getContentType(java.lang.String filename,
javax.servlet.http.HttpServletRequest request)
Retrieves the MIME type of the content to be returned. |
protected long |
getExpirationDate(javax.servlet.http.HttpServletRequest request)
Retrieves the expiration date of this content. |
protected java.lang.String |
getFilename(javax.servlet.http.HttpServletRequest request)
Retrieves the suggested name of the attachment to be returned to the request. |
protected long |
getLastModified(javax.servlet.http.HttpServletRequest request)
Returns the time the content was last modified, in milliseconds since midnight January 1, 1970 GMT. |
protected void |
setHeaders(Browser browser)
Enables sub-classes to specify any additional headers prior to the content being written to the browser. |
| Methods inherited from class org.pajes.servlet.PajeServlet |
createPaje, createPaje, createPaje, doPost, getAbsoluteHREF, getBaseHREF, getMaxFileUploadSize, getPajeFactory, getResource, getUploadedFile, getUploadedFileNames, handleException, init, log, log, service, setInputFieldsFromRequestAttributes, setInputFieldsFromRequestParameters, setMaxFileUploadSize, setPajeFactory |
| Methods inherited from class javax.servlet.http.HttpServlet |
doDelete, doHead, doOptions, doPut, doTrace, service |
| Methods inherited from class javax.servlet.GenericServlet |
destroy, getInitParameter, getInitParameterNames, getServletConfig, getServletContext, getServletInfo, getServletName, init |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
protected StaticPajeServlet()
protected StaticPajeServlet(java.lang.String contentType)
contentType - the default type of the static content to be
returned.| Method Detail |
protected abstract byte[] getContent(javax.servlet.http.HttpServletRequest request)
throws java.io.IOException
request - the request object.
byte array of the content this servlet will
return.
java.io.IOException
protected java.lang.String getContentType(java.lang.String filename,
javax.servlet.http.HttpServletRequest request)
throws java.io.IOException
getFilename(javax.servlet.http.HttpServletRequest)
returns null or a name from which the MIME type cannot be determined, a
default of text/plain will be used.
Sub-classes may over-ride this method to dynamically determine the MIME type.
filename - the value returned by getFilename(javax.servlet.http.HttpServletRequest).request - the request object.
java.io.IOException - if an I/O error occurs.protected long getExpirationDate(javax.servlet.http.HttpServletRequest request)
Sub-classes may over-ride this method to return a different expiration date.
request - the request object.
protected java.lang.String getFilename(javax.servlet.http.HttpServletRequest request)
throws java.io.IOException
Sub-classes may over-ride this method to return a file name specific to the attachment. The default implementation returns null, which means that the content will be returned to the browser WITHOUT a CONTENT-DISPOSITION header indicating that the content is an attachment and suggesting a default file name.
request - the request object.
java.io.IOException - if an I/O error occurs.protected void setHeaders(Browser browser)
By default, the following items are already set prior to invoking this method:
Browser.setExpirationDate(long) (see #getExpirationDate)
Browser.setLastModifiedDate(long) (see #getLastModified)
Browser.useCompression(boolean) (set to false)
The content type specified on the constructor and the content length
(determined from getContent(javax.servlet.http.HttpServletRequest)) have alos been set on the
response.
browser - the Browser object.protected long getLastModified(javax.servlet.http.HttpServletRequest request)
request - the HttpServletRequest object that is sent
to the servlet
long integer specifying the time the
HttpServletRequest object was last modified, in
milliseconds since midnight, January 1, 1970 GMT, or -1 if the
time is not known
protected void doGet(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
throws javax.servlet.ServletException,
java.io.IOException
doGet in class PajeServletrequest - the request object.response - the response object.
javax.servlet.ServletException - if the request could not be handled.
java.io.IOException - if an input or output error is detected when the
servlet handles the request.
|
PAJES 2.3.9 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||