com.creamtec.ajaxswing.examples
Class RouterRequestFilterExample

java.lang.Object
  extended by com.creamtec.ajaxswing.examples.RouterRequestFilterExample
All Implemented Interfaces:
RouterRequestFilter

public class RouterRequestFilterExample
extends java.lang.Object
implements RouterRequestFilter

Demonstrates an implementation of RouterRequestFilter interface. See documentation for more information.


Constructor Summary
RouterRequestFilterExample()
           
 
Method Summary
 boolean postProcessRequest(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, AppDesc appDesc, ClientAgentRemote agent, HttpRequestData requestData)
          Called when a new HTTP request is received by the router after the AjaxSwing related information has been extracted from the request and the appropriate client agent located.
 boolean preProcessRequest(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
          Called when a new HTTP request is received by the router before any processing has been done.
 boolean processResponse(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, AppDesc appDesc, ClientAgentRemote agent, HttpRequestData requestData, HttpResponseData responseData)
          Called when the client agent has finished processing the request and has returned a page.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RouterRequestFilterExample

public RouterRequestFilterExample()
Method Detail

preProcessRequest

public boolean preProcessRequest(javax.servlet.http.HttpServletRequest request,
                                 javax.servlet.http.HttpServletResponse response)
Description copied from interface: RouterRequestFilter
Called when a new HTTP request is received by the router before any processing has been done. If false is returned by this method, the request filter is responsible for creating the HTML output and writing it to the response.

Specified by:
preProcessRequest in interface RouterRequestFilter
Parameters:
request - HttpServletRequest
response - HttpServletResponse
Returns:
true to continue processing the request, false to stop processing and return

postProcessRequest

public boolean postProcessRequest(javax.servlet.http.HttpServletRequest request,
                                  javax.servlet.http.HttpServletResponse response,
                                  AppDesc appDesc,
                                  ClientAgentRemote agent,
                                  HttpRequestData requestData)
                           throws java.lang.Exception
Description copied from interface: RouterRequestFilter
Called when a new HTTP request is received by the router after the AjaxSwing related information has been extracted from the request and the appropriate client agent located. If false is returned by this method, the request filter is responsible for creating the HTML output and writing it to the response.

Specified by:
postProcessRequest in interface RouterRequestFilter
Parameters:
request - HttpServletRequest
response - HttpServletResponse
appDesc - Application descriptor used by AjaxSwing to maintain the application information
agent - Client agent associated with the request. Can be in the same JVM or in a different JVM.
requestData - Request data that is going to be sent to the client agent.
Returns:
true to continue processing the request, false to stop processing and return
Throws:
java.lang.Exception - on error

processResponse

public boolean processResponse(javax.servlet.http.HttpServletRequest request,
                               javax.servlet.http.HttpServletResponse response,
                               AppDesc appDesc,
                               ClientAgentRemote agent,
                               HttpRequestData requestData,
                               HttpResponseData responseData)
                        throws java.lang.Exception
Description copied from interface: RouterRequestFilter
Called when the client agent has finished processing the request and has returned a page. Can be used to change the generated page, replace or page or send a redirect using servlet API. If the method returns false, it is responsible for writing the output to HttpServletResponse

Specified by:
processResponse in interface RouterRequestFilter
Parameters:
request - HttpServletRequest
response - HttpServletResponse
appDesc - AppDesc
agent - ClientAgentRemote
requestData - HttpRequestData
responseData - HttpResponseData
Returns:
boolean true to continue processing, false to return
Throws:
java.lang.Exception - on error


Copyright © 2000-2012 CreamTec LLC. All Rights Reserved.