com.taggercat.controller
Class URIRedirectResolver

java.lang.Object
  extended by com.taggercat.controller.URIRedirectResolver
All Implemented Interfaces:
RedirectResolver

public class URIRedirectResolver
extends java.lang.Object
implements RedirectResolver

This is the standard Redirect Resolver. It resolves a target response page and data state into an unique URI representation.

If we are dealing with a known response page, then we can use a re-direct to a bookmarkable URI as part of the POST-REDIRECT-GET (PRG) pattern.

Known response pages are those that have been configured in the metadata on the meta-entity objects. The meta data provides for specifying a Default Search Page, and a Default Edit Page. In our case, we also infer a default view page ( non edit scalar ) to be named in the same pattern as the Edit page.

The RedirectResolver works in conjunction with the FlashScopeRequestWrapper and the AbstractURIRequestHandler. This default implementation generates URIs for scalar and search views. A sub class can be installed to generate URIs of different structures.

When a redirect URI is generated, it is usually the URIRequestHandler that handles the subsequent redirect request. The Redirect URI ( path info ) for searching is patterned like:
 /Requirement/search/ctProject/21/ctPhase/4
 
The Redirect URI for the view (detail) and edit pages is as such:
 /Requirement/view/410 or 
 /Requirement/edit/410
 

You must add a context parameter to your application's deployment descriptor to register this class. See the Programmer's Guide for more detailed information.

See Also:
AbstractURIHandler
 

Constructor Summary
URIRedirectResolver()
           
 
Method Summary
 java.lang.String getRedirectURI(java.lang.String responsePage, javax.servlet.http.HttpServletRequest request)
          Return a non-null value to have the response redirected.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

URIRedirectResolver

public URIRedirectResolver()
Method Detail

getRedirectURI

public java.lang.String getRedirectURI(java.lang.String responsePage,
                                       javax.servlet.http.HttpServletRequest request)
Description copied from interface: RedirectResolver
Return a non-null value to have the response redirected. Returning a null values will cause the response to be generated using a standard forward.

Specified by:
getRedirectURI in interface RedirectResolver
request - the http request object
Returns:
the URI to redirect to, otherwise, null.