org.apache.beehive.netui.tags.databinding.invoke
Class CallPageFlow

Object
  extended by TagSupport
      extended by BodyTagSupport
          extended by AbstractClassicTag
              extended by AbstractCallMethod
                  extended by CallMethod
                      extended by CallPageFlow
All Implemented Interfaces:
Serializable, BodyTag, IterationTag, JspTag, Tag, INetuiTag

public class CallPageFlow
extends CallMethod

Calls methods on the current Page Flow. If no Controller file is found, an ObjectNotFoundException is thrown and the tag execution fails. Any return value is stored in the ${pageScope...} data binding context object under the attribute specified by the resultId attribute.

For example, given a hello method and the following <netui-data:callPageFlow> tag:

 <netui-data:callPageFlow method="hello" resultId="helloMessage"/>
 

the result of the call is stored in the ${pageScope} JSP EL implicit object under the attribute helloMessage. It will be accessible via ${pageScope.helloMessage} and can be used as:

     <netui:span value="${pageScope.helloMessage}"/>
 

In JSP scriptlet, the result can be retrieved by calling the getAttribute() method on the javax.servlet.jsp.PageContext object:

     <%= pageContext.getAttribute("helloMessage") %>
 

See Also:
Serialized Form
Example
In the following sample, the <netui-data:callPageFlow> tag calls the sumCartItems method on the Controller file. The Span tag accesses the result through the ${pageScope} data binding context.
      <netui-data:callPageFlow method="sumCartItems" resultId="cartSum">
          <netui-data:methodParameter value="${pageFlow.cart.lineItemList}"/>
      </netui-data:callPageFlow>
      ...
      <netui:span value="${pageScope.cartSum}"/>
 

Nested Class Summary
 
Nested classes/interfaces inherited from class AbstractCallMethod
AbstractCallMethod.ParamNode
 
Field Summary
 
Fields inherited from class AbstractClassicTag
DefaultNamingChain, NETUI_UNIQUE_CNT
 
Fields inherited from class BodyTagSupport
bodyContent
 
Fields inherited from class TagSupport
id, pageContext
 
Fields inherited from interface BodyTag
EVAL_BODY_BUFFERED, EVAL_BODY_TAG
 
Fields inherited from interface IterationTag
EVAL_BODY_AGAIN
 
Fields inherited from interface Tag
EVAL_BODY_INCLUDE, EVAL_PAGE, SKIP_BODY, SKIP_PAGE
 
Constructor Summary
CallPageFlow()
           
 
Method Summary
protected  String getObjectName()
          Get the name of the object that is the target of the invocation.
 String getTagName()
          Get the name of this tag.
protected  Object resolveObject()
          Get the PageFlow for the using JSP's directory.
 
Methods inherited from class CallMethod
findMethod, localRelease, setObject
 
Methods inherited from class AbstractCallMethod
addParameter, allowNullInvocationTarget, doEndTag, doStartTag, getParameterNodes, handleReturnValue, setFailOnError, setMethod, setResultId
 
Methods inherited from class AbstractClassicTag
applyNamingChain, getErrorsReport, getIdForTagId, getNamingChain, getNearestForm, getNextId, getScriptReporter, getUserLocale, hasErrors, qualifyAttribute, registerTagError, registerTagError, reportAndExit, reportErrors, rewriteName, setNonEmptyValueAttribute, setRequiredValueAttribute, write
 
Methods inherited from class BodyTagSupport
doAfterBody, doInitBody, getBodyContent, getPreviousOut, release, setBodyContent
 
Methods inherited from class TagSupport
findAncestorWithClass, getId, getParent, getValue, getValues, removeValue, setId, setPageContext, setParent, setValue
 
Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface Tag
getParent, setPageContext, setParent
 

Constructor Detail

CallPageFlow

public CallPageFlow()
Method Detail

getTagName

public String getTagName()
Get the name of this tag. This is used to identify the type of this tag for reporting tag errors.

Specified by:
getTagName in interface INetuiTag
Overrides:
getTagName in class CallMethod
Returns:
a constant String representing the name of this tag.

getObjectName

protected String getObjectName()
Get the name of the object that is the target of the invocation.

Overrides:
getObjectName in class CallMethod
Returns:
a name for the object on which the method will be invoked.

resolveObject

protected Object resolveObject()
                        throws ObjectNotFoundException
Get the PageFlow for the using JSP's directory. This is an implementation of the CallMethod.resolveObject() method that finds the current PageFlow using the PageFlowUtils.getCurrentPageFlow(javax.servlet.http.HttpServletRequest, javax.servlet.ServletContext) method.

Overrides:
resolveObject in class CallMethod
Returns:
the current PageFlow. If there is no current PageFlow, the ObjectNotFoundException will be thrown.
Throws:
ObjectNotFoundException - when an exception occurs ensuring that a Page Flow is created.