|
BEA NetUI tags and APIs are included for backward compatibility only. For new applications, use the Beehive tags and APIs. | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object javax.servlet.jsp.tagext.TagSupport javax.servlet.jsp.tagext.BodyTagSupport com.bea.wlw.netui.tags.AbstractBaseTag com.bea.wlw.netui.tags.databinding.invoke.AbstractCallMethod com.bea.wlw.netui.tags.databinding.invoke.CallMethod
public class CallMethod
An abstract base class for tags that are capable of reflectively invoking methods. Specializations of this tag provide method implementations that locate the object on which to invoke the method and that handle any return value from the invoked method.
The CallMethod
tag can have child tags of type
MethodParameter
; these tags must be in the same
order as the parameter list in the method signature of the
method that will be invoked. To invoke an overloaded method, the
MethodParameter.setValue(java.lang.String)
} property must be set to the String
name of the type to pass to the method. If the type attribute values
on nested MethodParameter
tags do not match any method signature,
an error will be reported in the page.
Attribute Descriptions | |||
---|---|---|---|
Attribute | Required | Runtime Expression Evaluation | Data Bindable |
failOnError | No | No | No |
A boolean that if true will cause the tag to report any method
invocation errors in-line in the rendered page. | |||
method | No | No | No |
The method to invoke on an object. | |||
object | No | No | Yes |
References an object on which the method will be invoked. | |||
resultId | No | No | No |
The PageContext attribute name where the result,
if non-null, is stored. |
MethodParameter
,
CallControl
,
CallPageFlow
,
Serialized FormgetShippingState(int i)
.
One parameter is passed to the method: the integer 1.
<netui-data:callMethod object="{pageFlow}" method="getShippingState" failOnError="true" resultId="test"> <netui-data:methodParameter type="int" value="1" /> </netui-data:callMethod>
[BEA_HOME]/weblogic81/samples/workshop/SamplesApp/tagSamples/netui_databinding/callMethod/callMethod.jsp
The controlId
attribute is used to specify the cclass to be called.
The value returned is stored in the
{pageContext...}
data binding context object under the
attribute specified by the resultId
attribute.
For example, if you call a Java class with the following <netui-data:callMethod> tag...
<netui-data:callMethod object="{pageFlow}" method="hello" resultId="helloMessage" />
...the result of the call is stored in the {pageContext...}
data binding context under the
attribute helloMessage
.
The result can be retrieved with the data binding expression
{pageContext.helloMessage}
<netui:label value="{pageContext.helloMessage}"/>In a scriptlet, the result can be retrieved by calling the
getAttribute()
method on the
javax.servlet.jsp.PageContext
object:
<%= pageContext.getAttribute("helloMessage") %>
Note that only synchronous methods can be called with <netui-data:callMethod>. For handling asynchronous methods see the help topic Calling Web Services and Custom Java Controls From A Page Flow
Nested Class Summary |
---|
Nested classes/interfaces inherited from class com.bea.wlw.netui.tags.databinding.invoke.AbstractCallMethod |
---|
AbstractCallMethod.ParamNode |
Field Summary |
---|
Fields inherited from class com.bea.wlw.netui.tags.AbstractBaseTag |
---|
ATTR_GENERAL, ATTR_GENERAL_EXPRESSION, ATTR_JAVASCRIPT, ATTR_STYLE, JAVASCRIPT_STATUS, NETUI_UNIQUE_CNT |
Fields inherited from class javax.servlet.jsp.tagext.BodyTagSupport |
---|
bodyContent |
Fields inherited from class javax.servlet.jsp.tagext.TagSupport |
---|
id, pageContext |
Fields inherited from interface com.bea.wlw.netui.tags.html.HtmlConstants |
---|
ACCEPT, ACCESSKEY, ACTION, ALIGN, ALINK, ALT, ANCHOR, BACKGROUND, BASE, BGCOLOR, BODY, BORDER, BR, CAPTION, CELLPADDING, CELLSPACING, CHAR, CHAROFF, CHARSET, CHECKED, CLASS, COLS, COORDS, DIR, DISABLED, DIV, ENCTYPE, FOR, FORM, FORM_GET, FORM_POST, FRAME, HEIGHT, HREF, HREFLANG, HSPACE, HTML, ID, IMAGE, INPUT, INPUT_BUTTON, INPUT_CHECKBOX, INPUT_FILE, INPUT_HIDDEN, INPUT_IMAGE, INPUT_PASSWORD, INPUT_RADIO, INPUT_RESET, INPUT_SUBMIT, INPUT_TEXT, ISMAP, LABEL, LANG, LINK, LONGDESC, MAXLENGTH, METHOD, NAME, ONBLUR, ONCHANGE, ONCLICK, ONDBLCLICK, ONFOCUS, ONKEYDOWN, ONKEYPRESS, ONKEYUP, ONLOAD, ONMOUSEDOWN, ONMOUSEMOVE, ONMOUSEOUT, ONMOUSEOVER, ONMOUSEUP, ONRESET, ONSELECT, ONSUBMIT, ONUNLOAD, OPTION, READONLY, REL, REV, ROWS, RULES, SELECT, SHAPE, SIZE, SPAN, SRC, STYLE, SUMMARY, TABINDEX, TABLE, TARGET, TD, TEXT, TEXTAREA, TITLE, TR, TYPE, USEMAP, VALIGN, VALUE, VLINK, VSPACE, WIDTH |
Fields inherited from interface javax.servlet.jsp.tagext.BodyTag |
---|
EVAL_BODY_BUFFERED, EVAL_BODY_TAG |
Fields inherited from interface javax.servlet.jsp.tagext.IterationTag |
---|
EVAL_BODY_AGAIN |
Fields inherited from interface javax.servlet.jsp.tagext.Tag |
---|
EVAL_BODY_INCLUDE, EVAL_PAGE, SKIP_BODY, SKIP_PAGE |
Constructor Summary | |
---|---|
CallMethod()
|
Method Summary | |
---|---|
protected Method |
findMethod(Object target,
String methodName,
boolean verifyTypes)
The default findMethod implementation is an uncached search of all of the methods available on the Class of the target |
String |
getObject()
Get the object on which a method will be invoked. |
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 void |
localRelease()
Reset all of the fields of this tag. |
protected Object |
resolveObject()
Resolve the object on which the method should be invoked. |
void |
setObject(String object)
Set the object on which to invoke a method. |
Methods inherited from class com.bea.wlw.netui.tags.databinding.invoke.AbstractCallMethod |
---|
addParameter, doEndTag, doStartTag, getFailOnError, getMethod, getParameterNodes, getResultId, handleReturnValue, setFailOnError, setMethod, setResultId |
Methods inherited from class javax.servlet.jsp.tagext.BodyTagSupport |
---|
doAfterBody, doInitBody, getBodyContent, getPreviousOut, setBodyContent |
Methods inherited from class javax.servlet.jsp.tagext.TagSupport |
---|
findAncestorWithClass, getId, getParent, getValue, getValues, removeValue, setId, setParent, setValue |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface javax.servlet.jsp.tagext.Tag |
---|
getParent, setParent |
Constructor Detail |
---|
public CallMethod()
Method Detail |
---|
public String getTagName()
getTagName
in class AbstractBaseTag
public void setObject(String object)
object
- the object on which to invoke a methodpublic String getObject()
protected void localRelease()
localRelease
in class AbstractCallMethod
protected Object resolveObject() throws ObjectNotFoundException
AbstractCallMethod
Resolve the object on which the method should be invoked. If there are
errors resolving this object, this method will throw an ObjectNotFoundException
.
If the object is not found but no exception occurred, this method should return null.
resolveObject
in class AbstractCallMethod
ObjectNotFoundException
- if an exception occurred attempting to resolve an objectprotected final Method findMethod(Object target, String methodName, boolean verifyTypes)
AbstractCallMethod
target
findMethod
in class AbstractCallMethod
target
- the object from which to find the methodmethodName
- the name of the method to findverifyTypes
- a boolean that if true will match the type names in addition to the String method name
verifyTypes
is true.
null
otherwise.protected String getObjectName()
AbstractCallMethod
getObjectName
in class AbstractCallMethod
|
BEA NetUI tags and APIs are included for backward compatibility only. For new applications, use the Beehive tags and APIs. | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |