org.mentawai.core
Class Forward

java.lang.Object
  extended by org.mentawai.core.Forward
All Implemented Interfaces:
Consequence

public class Forward
extends Object
implements Consequence

A forward web consequence.

Author:
Sergio Oliveira

Field Summary
static String ACTION_REQUEST
          The action is set in the request with this name
static String APPLICATION_REQUEST
          The application context is set in the request with this name
static String INPUT_REQUEST
          The action input is set in the request with this name
static String SESSION_REQUEST
          The session context is set in the request with this name
 
Constructor Summary
Forward(String url)
          Creates a web consequence for the given url.
 
Method Summary
 void execute(Action a, String result, javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse res)
          Executes this consequence.
static void forward(String url, javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse res)
          Forward your web application to an URL.
 String getUrl()
           
 void setUrl(String url)
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

ACTION_REQUEST

public static String ACTION_REQUEST
The action is set in the request with this name


SESSION_REQUEST

public static String SESSION_REQUEST
The session context is set in the request with this name


APPLICATION_REQUEST

public static String APPLICATION_REQUEST
The application context is set in the request with this name


INPUT_REQUEST

public static String INPUT_REQUEST
The action input is set in the request with this name

Constructor Detail

Forward

public Forward(String url)
Creates a web consequence for the given url.

Parameters:
url - The url for the forward
Method Detail

execute

public void execute(Action a,
                    String result,
                    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
Parameters:
a - The action that generated this consequence.
result - The result generated by the action.
req - The servlet request of the action.
res - The servlet response of the action.
Throws:
ConsequenceException

forward

public static void forward(String url,
                           javax.servlet.http.HttpServletRequest req,
                           javax.servlet.http.HttpServletResponse res)
                    throws javax.servlet.ServletException,
                           IOException
Forward your web application to an URL.

Parameters:
url - The url for the forward.
req - The http servlet request.
res - the http servlet response.
Throws:
javax.servlet.ServletException
IOException

toString

public String toString()
Overrides:
toString in class Object

getUrl

public String getUrl()

setUrl

public void setUrl(String url)


Copyright © 2013. All Rights Reserved.