|
Expresso 5-6 | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectcom.jcorporate.expresso.ext.struts.taglib.ControllerUtils
Utilities for use by the extended "expresso-aware" Struts tags
| Constructor Summary | |
ControllerUtils()
|
|
| Method Summary | |
static boolean |
exists(PageContext pageContext,
String name,
String property)
Determines if the defined name and property combination exists in the ControllerResponse for the page context |
static ControllerElement |
findElement(PageContext pageContext,
String name,
String property)
Finds a controller element specified by name and/or property |
static Input |
findInput(PageContext pageContext,
String property)
Find an input out of the ControllerReponse |
static Transition |
findTransition(PageContext pageContext,
String property)
Locate and return the transition named by the specified property |
static String |
getBeanProperty(PageContext pageContext,
String name,
String property,
boolean ignore)
We interpret property names as follows: A "normal" name (e.g. no special characters) should represent the contents of an output object. |
static ControllerResponse |
getResponse(PageContext pageContext)
Get the current ControllerResponse object from the session |
static String |
getSpecificBeanProperty(PageContext pageContext,
String name,
String property,
boolean ignore)
Get a property from a specific ControllerElement stored as a bean in the current page |
static ControllerElement |
interpretLeadElement(PageContext pageContext,
String beanExpr)
Inteprets the lead argument for InputTag expression where the bean expression is a scope for the type of controller that should be retrieved from the ControllerResponse.
|
static String |
nestedProperty(PageContext pageContext,
String name,
String property)
Deprecated. use nestedProperty(PageContext, name, property, checkExists) instead |
static String |
nestedProperty(PageContext pageContext,
String name,
String property,
boolean checkExists)
If we were asked for a property that contains a "/", then we're referring to either a property of or a value of a "nested" property |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public ControllerUtils()
| Method Detail |
public static String getBeanProperty(PageContext pageContext,
String name,
String property,
boolean ignore)
throws JspException
ignore is not actually used and
will be removed in future versions
pageContext - the JSP page contextname - the name of the bean to retrieveproperty - the name of the bean property to retrieveignore - Ignore errors and return null if the bean property isn't
found?
JspException - upon errorpublic static final ControllerResponse getResponse(PageContext pageContext)
pageContext - the jsp page context
public static String getSpecificBeanProperty(PageContext pageContext,
String name,
String property,
boolean ignore)
throws JspException
pageContext - the JSP page contextname - the name of the bean to retrieveproperty - the name of the bean property to retrieveignore - Unused and to be removed in a future release
JspException - upon error
public static boolean exists(PageContext pageContext,
String name,
String property)
throws JspException
pageContext - The Jsp Page Context to retrieve the ControllerResponse
fromname - The name of the bean to be searching for. If not null then
we're looking for a bean other than ControllerReponseproperty - The name of the property (possibly nested) to retrieve
JspException - on issues like Type Mismatches.
public static ControllerElement interpretLeadElement(PageContext pageContext,
String beanExpr)
throws ControllerException
ControllerResponse.
The bean expression is a string, which must be formatted as "<ELEMENT-SCOPE> : <ELEMENT-NAME>".
Where ELEMENT-SCOPE is a string member of
block,
input,
output, and
transition.
The ELEMENT-NAME specifies the name of the controller element
to retrieve.
Here is an example of what we are trying to achieve with this method. This is taken from the eForum:
<html:textarea name="block:optionsBlock"
property="/signature" cols="80" rows="6" />
IDEA: Should this method support nested controller elements
pageContext - the page contextbeanExpr - the bean expression
ControllerException - if problem occurs retrieving the element
public static ControllerElement findElement(PageContext pageContext,
String name,
String property)
pageContext - The jsp page contextname - the name of the bean to get. may be null if we're looking
for top level controller elements.property - the property to retrieve. If we have both a name AND a property,
then the property must start with a "/" and then each successive
forward slash indicates walking through nested controller elements until we
find what we're looking for.
ControllerElement or null.
public static Input findInput(PageContext pageContext,
String property)
throws JspException
pageContext - property -
JspException
public static Transition findTransition(PageContext pageContext,
String property)
throws JspException
JspException
public static String nestedProperty(PageContext pageContext,
String name,
String property)
throws JspException
pageContext - name - property -
JspException
public static String nestedProperty(PageContext pageContext,
String name,
String property,
boolean checkExists)
throws JspException
pageContext - name - property - checkExists -
JspException
|
Expresso 5-6 | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||