net.sourceforge.stripes.action
Class RedirectResolution

java.lang.Object
  extended by net.sourceforge.stripes.action.OnwardResolution
      extended by net.sourceforge.stripes.action.RedirectResolution
All Implemented Interfaces:
Resolution

public class RedirectResolution
extends OnwardResolution
implements Resolution

Resolution that uses the Servlet API to redirect the user to another path by issuing a client side redirect. Unlike the ForwardResolution the RedirectResolution can send the user to any URL anywhere on the web - though it is more commonly used to send the user to a location within the same application.

Author:
Tim Fennell
See Also:
ForwardResolution

Field Summary
 
Fields inherited from class net.sourceforge.stripes.action.OnwardResolution
path
 
Constructor Summary
RedirectResolution(String url)
          Simple constructor that takes the URL to which to forward the user.
 
Method Summary
 void execute(HttpServletRequest request, HttpServletResponse response)
          Attempts to redirect the user to the specified URL.
 
Methods inherited from class net.sourceforge.stripes.action.OnwardResolution
getPath, setPath, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

RedirectResolution

public RedirectResolution(String url)
Simple constructor that takes the URL to which to forward the user.

Parameters:
url - the URL to which the user's browser should be re-directed.
Method Detail

execute

public void execute(HttpServletRequest request,
                    HttpServletResponse response)
             throws ServletException,
                    IOException
Attempts to redirect the user to the specified URL.

Specified by:
execute in interface Resolution
Specified by:
execute in class OnwardResolution
Parameters:
request - the current HttpServletRequest
response - the current HttpServletResponse
Throws:
ServletException - thrown when the Servlet container encounters an error
IOException - thrown when the Servlet container encounters an error


© Copyright 2005, Stripes Development Team.