public class UseActionBeanTag extends StripesTagSupport
This tag supports the use of Stripes ActionBean classes as view helpers. It allows for the use of actions as the controller and then their reuse on the page, creating it if it does not exist. A typical usage pattern would be for a page that contains two types of information, the interaction with each being handled by separate ActionBean implementation. Some page events route to the first action and others to the second, but the page still requires data from both in order to render. This tag would define both ActionBeans in the page scope, creating the one that wasn't executing the event.
This class will bind parameters to a created ActionBean just as the execution of an event on an ActionBean would. It does not rebind values to ActionBeans that were previously created for execution of the action. Validation is not done during this binding, except the type conversion required for binding, and no validation errors are produced.
The binding of the ActionBean to the page scope happens whether the ActionBean is created or not, making for a consistent variable to always use when referencing the ActionBean.
pageContext, parentTag
Constructor and Description |
---|
UseActionBeanTag() |
Modifier and Type | Method and Description |
---|---|
int |
doEndTag()
Does nothing.
|
int |
doStartTag()
The main work method of the tag.
|
java.lang.String |
getBinding()
Get the UrlBinding of the requested ActionBean
|
java.lang.String |
getEvent()
The event name, if any to execute.
|
java.lang.String |
getId()
Alias for getVar() so that the JSTL and jsp:useBean style are allowed.
|
java.lang.String |
getVar()
Gets the name of the page scope variable to which the ActionBean will be bound.
|
boolean |
isAlwaysExecuteEvent() |
boolean |
isExecuteResolution() |
boolean |
isValidate() |
void |
setAlwaysExecuteEvent(boolean alwaysExecuteEvent) |
void |
setBeanclass(java.lang.Object beanclass)
Sets the binding attribute by figuring out what ActionBean class is identified
and then in turn finding out the appropriate URL for the ActionBean.
|
void |
setBinding(java.lang.String binding)
Set the UrlBinding of the requested ActionBean
|
void |
setEvent(java.lang.String event)
The event name, if any to execute.
|
void |
setExecuteResolution(boolean executeResolution) |
void |
setId(java.lang.String id)
Alias for setVar() so that the JSTL and jsp:useBean style are allowed.
|
void |
setValidate(boolean validate) |
void |
setVar(java.lang.String var)
Sets the name of the page scope variable to which the ActionBean will be bound.
|
getActionBeanType, getActionBeanUrl, getPageContext, getParent, getParentTag, getTagStack, popPageContextAttributes, pushPageContextAttributes, release, setPageContext, setParent
public int doStartTag() throws javax.servlet.jsp.JspException
doStartTag
in interface javax.servlet.jsp.tagext.Tag
doStartTag
in class StripesTagSupport
javax.servlet.jsp.JspException
- if the ActionBean could not be instantiate and executedpublic int doEndTag()
doEndTag
in interface javax.servlet.jsp.tagext.Tag
doEndTag
in class StripesTagSupport
public void setBeanclass(java.lang.Object beanclass) throws StripesJspException
beanclass
- the FQN of an ActionBean class, or a Class object for one.StripesJspException
public java.lang.String getBinding()
public void setBinding(java.lang.String binding)
public java.lang.String getEvent()
public void setEvent(java.lang.String event)
public java.lang.String getVar()
public void setVar(java.lang.String var)
public java.lang.String getId()
public void setId(java.lang.String id)
public boolean isValidate()
public void setValidate(boolean validate)
public boolean isAlwaysExecuteEvent()
public void setAlwaysExecuteEvent(boolean alwaysExecuteEvent)
public boolean isExecuteResolution()
public void setExecuteResolution(boolean executeResolution)
? Copyright 2005-2006, Stripes Development Team.