|
Expresso 5-6 | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectcom.jcorporate.expresso.core.controller.ControllerResponse
com.jcorporate.expresso.core.controller.ServletControllerResponse
A ServletControllerResponse object is an extension that provides
wide access to the pure Struts API and Servlet environment.
For example you may want to generate dynamic ActionForwards
or retrieve access to the ActionMapping class.
public AcmeController extends DBController {
protected void runProcessOrderState(
ControllerRequest req,
ControllerRequest res )
{
ServletControllerRequest request =
(ServletControllerRequest)req;
ActionMapping mapping = request.getMapping();
ServletControllerResponse request =
(ServletControllerRequest)req;
ActionMapping mapping = response.getMapping();
// ... after processing this state ...
response.setActionForward(
new ActionForward( ... ));
// OR
response.setActionForward(
repsonse.findForward( "logical-forward-name" ));
// OR
response.setFindForwardStore( "logical-forward-name" );
// OR
response.setForwardName( "logical-forward-name" );
// equivalent to
response.setStyle( "logical-forward-name" )
}
...
}
| Field Summary | |
protected org.apache.struts.action.ActionForward |
myForward
The associated action forward |
| Fields inherited from class com.jcorporate.expresso.core.controller.ControllerResponse |
blockCache, blockCacheOrdered, currentState, customResponse, dataContext, inputCache, inputCacheOrdered, myControllerClass, myRequest, myRequestPath, outputCache, outputCacheOrdered, requestedState, responseLocale, style, title, transitionCache, transitionCacheOrdered |
| Constructor Summary | |
ServletControllerResponse()
Default constructor for the servlet controller response |
|
| Method Summary | |
org.apache.struts.action.ActionForward |
findForward(String forwardName)
Searches for the action forward associated with the action mapping (controller). |
org.apache.struts.action.ActionForward |
findForwardStore(String forwardName)
Searches for the action forward associated with the action mapping (controller), with the side-effect of storing the action forward in the controller response. |
org.apache.struts.action.ActionForward |
getActionForward()
Gets the action forward that the controller should forward or redirect to |
String |
getForwardName()
Gets the logical name of the action forward that the controller should forward or redirect to. |
org.apache.struts.action.ActionMapping |
getMapping()
Gets the ActionMapping associated with the controller . |
void |
setActionForward(org.apache.struts.action.ActionForward forward)
Sets the action forward that the controller should forward or redirect to |
void |
setForwardName(String forwardName)
Sets the logical name of the action forward that the controller should forward or redirect to. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
protected org.apache.struts.action.ActionForward myForward
| Constructor Detail |
public ServletControllerResponse()
| Method Detail |
public org.apache.struts.action.ActionMapping getMapping()
throws ControllerException
((ServletControllerRequest)getRequest()).getMapping()
ClassCastException - if the associated controller request object
is not a ServletControllerRequest type.
ControllerException - if there is no associated controller
request object at all.ServletControllerRequest.getMapping()public org.apache.struts.action.ActionForward getActionForward()
setActionForward(org.apache.struts.action.ActionForward)public void setActionForward(org.apache.struts.action.ActionForward forward)
forward - the action forward objectgetActionForward()
public org.apache.struts.action.ActionForward findForward(String forwardName)
throws ControllerException
getMapping().findForward("{logical-forward-name}")
forwardName - the logical name of the action forward
null
if none can be found.
ClassCastException - if the associated controller request object
is not a ServletControllerRequest type.
ControllerException - if there is no associated controller
request object at all.getMapping()
public org.apache.struts.action.ActionForward findForwardStore(String forwardName)
throws ControllerException
setActionForward( getMapping().findForward( "{logical-fwd-name}" ))
forwardName - the logical name of the action forward
null
if none can be found.
ClassCastException - if the associated controller request object
is not a ServletControllerRequest type.
ControllerException - if there is no associated controller
request object at all.getMapping()public String getForwardName()
setStyle method. It makes a lot more sense
to pure Struts developers who moving upto Expresso.
Functionally equivalent to setStyle()
setForwardName(java.lang.String),
ControllerResponse.getStyle()public void setForwardName(String forwardName)
setStyle method. It makes a lot more sense
to pure Struts developers who moving upto Expresso.
Functionally equivalent to setStyle()
forwardName - the logical name of the action forwardgetForwardName(),
ControllerResponse.setStyle(java.lang.String)
|
Expresso 5-6 | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||