Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

org.mentawai.core
Class Redirect  view Redirect download Redirect.java

java.lang.Object
  extended byorg.mentawai.core.Redirect
All Implemented Interfaces:
Consequence

public class Redirect
extends java.lang.Object
implements Consequence

A redirect web consequence. A normal redirect web consequence has just a url. A redirect may also have dynamic parameters and a dynamic url.


Field Summary
private  boolean appendOutput
           
private  boolean dynamicUrl
           
static java.lang.String REDIRURL_PARAM
          The parameter's name in the output for the dynamic redirect
private  java.lang.String url
           
 
Constructor Summary
Redirect()
          Creates a redirect with a dynamic url.
Redirect(java.lang.String url)
          Creates a normal redirect for the given url
Redirect(java.lang.String url, boolean appendOutput)
          Creates a redirect for the given url with dynamic parameters.
 
Method Summary
 void execute(Action a, javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse res)
          Executes this consequence.
private  java.lang.String putSlash(java.lang.String url)
           
static void redirect(java.lang.String url, javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse res)
          Redirect your web application to an URL.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

REDIRURL_PARAM

public static java.lang.String REDIRURL_PARAM
The parameter's name in the output for the dynamic redirect


url

private java.lang.String url

appendOutput

private boolean appendOutput

dynamicUrl

private boolean dynamicUrl
Constructor Detail

Redirect

public Redirect(java.lang.String url)
Creates a normal redirect for the given url


Redirect

public Redirect(java.lang.String url,
                boolean appendOutput)
Creates a redirect for the given url with dynamic parameters. The dynamic paramers are obtained from the output values.


Redirect

public Redirect()
Creates a redirect with a dynamic url. The dynamic url is obtanined from the output values.

Method Detail

putSlash

private java.lang.String putSlash(java.lang.String url)

execute

public void execute(Action a,
                    javax.servlet.http.HttpServletRequest req,
                    javax.servlet.http.HttpServletResponse res)
             throws ConsequenceException
Description copied from interface: Consequence
Executes this consequence. A consequence must do something with your web application. Here is where you define what the consequence does.

Specified by:
execute in interface Consequence

redirect

public static void redirect(java.lang.String url,
                            javax.servlet.http.HttpServletRequest req,
                            javax.servlet.http.HttpServletResponse res)
                     throws java.io.IOException
Redirect your web application to an URL.