|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.taggercat.handlers.AbstractRequestHandler
public abstract class AbstractRequestHandler
AbstractRequestHandler is an abstract implementation of the
RequestHandler interface.
It provides the basic services that most request handlers are expected to
provide, such as:
Model
![]() |
![]() |
![]() |
![]() |
| Constructor Summary | |
|---|---|
AbstractRequestHandler()
|
|
| Method Summary | |
|---|---|
static void |
disableClientCache(javax.servlet.http.HttpServletResponse response)
Disables browser caching by setting the magic response header values |
java.lang.String |
getDataSourceName()
Gets the dsName parameter or attribute from the request object. |
java.lang.Exception |
getErrorException()
|
java.lang.String |
getErrorPage()
|
ResponseMethod |
getErrorPageMethod()
|
java.lang.String |
getErrorReason()
|
java.lang.String |
getExplicitDataSourceName()
|
java.lang.String |
getExplicitDSN()
Returns the explicit data source name, or null is the explicit DSN has not been set. |
java.util.regex.Pattern |
getMatchedPattern()
|
Model |
getModel()
Gets the Model from the HttpSession. |
RequestController |
getRequestController()
|
java.lang.String |
getResponsePage()
|
ResponseMethod |
getResponsePageMethod()
|
java.lang.String |
getSessionExpiredPage()
|
java.lang.String |
getUserName4Log()
Gets the current application user name, if logged in. |
void |
init(RequestController requestController)
Called by RequestController to initialize this
RequestHandler. |
static boolean |
isAjaxRequest(javax.servlet.http.HttpServletRequest request)
Returns true if the request is being made from a TC or jQuery Ajax call |
void |
onChainCompleted(RequestHandler lastRequestHandler,
boolean success)
This method is called on each request handler in the request handler chain after the last request handler has been called. |
java.lang.Object |
resolveProperty(java.lang.String name,
com.taggercat.el.ELContext elContext)
This is the call back method registered with the expression evaluator. |
void |
serverTemporaryFile(java.io.File tempFile)
Sends a file to the output stream. |
void |
serveTemporaryFile(java.io.File tempFile,
java.lang.String contentType,
boolean asAttachment)
Sends a file to the output stream. |
boolean |
service(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response,
RequestHandlerChain requestChain)
Called by RequestController to service a single
request. |
void |
setActionName(java.lang.String name)
Sets the value of the request name associated with this handler. |
void |
setErrorPage(java.lang.String errorPage)
|
void |
setErrorPageMethod(ResponseMethod errorPageMethod)
|
void |
setErrorPageMethodToRedirect()
|
void |
setExplicitDataSourceName(java.lang.String explicitDataSourceName)
|
void |
setExplicitDSN(java.lang.String dsn)
Sets the explicit data source name. |
void |
setMatchedPattern(java.util.regex.Pattern matchedPattern)
|
void |
setResponsePage(java.lang.String responsePage)
|
void |
setResponsePageMethod(ResponseMethod responsePageMethod)
|
void |
setResponsePageMethodToRedirect()
|
void |
setSessionExpiredPage(java.lang.String sessionExpiredPage)
|
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public AbstractRequestHandler()
| Method Detail |
|---|
public java.lang.String getDataSourceName()
public void onChainCompleted(RequestHandler lastRequestHandler,
boolean success)
onChainCompleted in interface RequestHandlerlastRequestHandler - the request handler where chain processing completedsuccess - true if the last request handler has completed successfullypublic static void disableClientCache(javax.servlet.http.HttpServletResponse response)
public static boolean isAjaxRequest(javax.servlet.http.HttpServletRequest request)
public void serveTemporaryFile(java.io.File tempFile,
java.lang.String contentType,
boolean asAttachment)
throws java.io.IOException
After sending, that file will be deleted from the file system.
The requestHandler chain will also be marked as completed. You should NOT being using this method to serve regular static resources.
java.io.IOException
java.net.MalformedURLExceptiontempFile - contentType - the content type
public void serverTemporaryFile(java.io.File tempFile)
throws java.io.IOException
After sending, that file will be deleted from the file system.
The requestHandler chain will also be marked as completed. You should NOT being using this methods to server regular static resources.
java.io.IOExceptiontempFile - the file to servepublic Model getModel()
Model from the HttpSession.
Model previously set as an
attribute of the HttpSession, or null if the session or attribute
are not present.public java.lang.String getUserName4Log()
public void setActionName(java.lang.String name)
setActionName in interface RequestHandlername - the name of the requestpublic void init(RequestController requestController)
RequestController to initialize this
RequestHandler. You can provide your own setup code in this method. The
corresponding method at the end of the request processing is
AbstractRequestHandler.destroy().
init in interface RequestHandlerrequestController - RequestController instance.
public final boolean service(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response,
RequestHandlerChain requestChain)
throws java.lang.Exception
RequestController to service a single
request. If this request handler is in a chain, then the follow on request
handler will be called after this instance's handleRequest method is
called.
service in interface RequestHandlerjava.lang.Exception - Generally the underlying exception thrown for varied reasons
during the servicing of a request.request - current HttpServletRequest instanceresponse - current HttpServletResponse instancerequestChain - the chain of request handlers being processed
public void setExplicitDSN(java.lang.String dsn)
setExplicitDSN in interface RequestHandlerdsn - the data source namepublic java.lang.String getExplicitDSN()
getExplicitDSN in interface RequestHandler
public java.lang.Object resolveProperty(java.lang.String name,
com.taggercat.el.ELContext elContext)
throws java.lang.IllegalArgumentException
customer.Name request.orderDate session.user page.isValidThe attribute on the scope variables may have been added with the TCSet, TCOut etc. tags or with any other means.
resolveProperty in interface com.taggercat.el.ELPropertyResolverjava.lang.IllegalArgumentExceptionname - the dot delimited name of the term to resolve, eg, customer.NameelContext - the context values
public java.lang.String getResponsePage()
public void setResponsePage(java.lang.String responsePage)
public java.lang.String getErrorPage()
public void setErrorPage(java.lang.String errorPage)
public java.lang.String getErrorReason()
public java.lang.String getSessionExpiredPage()
public void setSessionExpiredPage(java.lang.String sessionExpiredPage)
public ResponseMethod getErrorPageMethod()
public void setErrorPageMethod(ResponseMethod errorPageMethod)
public java.lang.Exception getErrorException()
public java.lang.String getExplicitDataSourceName()
public void setExplicitDataSourceName(java.lang.String explicitDataSourceName)
public ResponseMethod getResponsePageMethod()
public void setResponsePageMethod(ResponseMethod responsePageMethod)
public void setResponsePageMethodToRedirect()
public void setErrorPageMethodToRedirect()
public RequestController getRequestController()
public java.util.regex.Pattern getMatchedPattern()
public void setMatchedPattern(java.util.regex.Pattern matchedPattern)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||