|
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.pageinput.DeclarePageInput
public class DeclarePageInput
The DeclarePageInput tag is used to declare variables that are passed to the page from
the page flow. A page input variable has a lifetime of the page in which it
is declared and can be referenced using the pageInput
data binding context.
The name
attribute here is used as the identifier for the variable inside
of this binding context, and the type
attribute is used to identify
the expected type of this variable.
Attribute Descriptions | |||
---|---|---|---|
Attribute | Required | Runtime Expression Evaluation | Data Bindable |
name | Yes | No | No |
The name of a variable that can be referenced in the page input data binding context. | |||
type | Yes | No | No |
The type of the variable referenced in the page input data binding context. |
foo
, is defined in the Controller file,
and its value is
passed to a JSP page by using the addPageInput
method and the
<netui-data:declarePageInput> tag.
/** * @jpf:action * @jpf:forward name="simple" path="simple.jsp" */ public Forward simple() { Forward f = new Forward("simple"); f.addPageInput("fooBean", new FooBean()); return f; } public static class FooBean { private String foo = "A Foo String"; public String getFoo() { return foo; } public void setFoo(String foo) { this.foo = foo; } }
<netui-data:declarePageInput name="fooBean" type="pageInput.PageInputController.FooBean"/> ... fooBean.foo: <netui:label value="{pageInput.fooBean.foo}" />
This tag declares variables that are passed from the Controller file to the JSP page.
The variable's lifetime is the same as that of the JSP page on which it is declared.
On the Controller file, use the addPageInput
method
(a method on the Forward
class)
to make the variable available to the <netui-data:declarePageInput> tag.
Forward f = new Forward("success"); f.addPageInput("myData", new MyData());Then, on the JSP page, declare the variable with the <netui-data:declarePageInput> tag.
<netui-data:declarePageInput name="myData" type="myPageFlow.MyPageFlowController.MyData"/>
Once declared, the variable can be referenced using the
{pageInput...}
data binding context.
The name
attribute is used as the identifier for the variable inside
of this binding context, and the type
attribute is used to identify
the expected type of this variable.
<netui:label value="{pageInput.myData}"/>
Using the <netui-data:declarePageInput> has the following advantages
- The presence of <netui-data:declarePageInput> tags in a JSP file helps to indicate clearly the type of data expected at run time. This information about the incoming data helps your team understand any data dependencies a given JSP page may have on the Controller file.
- At design time each <netui-data:declarePageInput> tag, once added to a JSP page, enables an additional WebLogic Workshop IDE feature to discover properties about your JSP source code.
For example, the presence of a <netui-data:declarePageInput> tag on a JSP page causes the Workshop IDE to display the declared variable in the Data Palette's "Page Inputs" section. Once the variable is displayed in the Data Palette, you can (1) drag and drop the variable from the Data Palette, and (2) set properties on the variable. Note that the Data Palette will not display the following data types:
primitive Java types
java.*
javax.*
com.sun.*
org.apache.struts.*
com.bea.*
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 | |
---|---|
DeclarePageInput()
|
Method Summary | |
---|---|
int |
doEndTag()
|
int |
doStartTag()
|
String |
getName()
Get the name of the variable that can be referenced using the page input data binding context. |
String |
getTagName()
Get the name of this tag. |
String |
getType()
Get the type of the variable that referenced with the |
protected void |
localRelease()
Reset all of the fields of this tag. |
void |
setName(String name)
Set the name of a variable that can be referecned using the page input data binding context. |
void |
setType(String type)
Set the type of the variable that referenced with the |
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 DeclarePageInput()
Method Detail |
---|
public void setName(String name)
name
- the name of the variablepublic String getName()
public void setType(String type)
type
- the type of the variable that is referencedpublic String getType()
public String getTagName()
getTagName
in class AbstractBaseTag
public int doStartTag()
doStartTag
in interface javax.servlet.jsp.tagext.Tag
doStartTag
in class javax.servlet.jsp.tagext.BodyTagSupport
public int doEndTag() throws javax.servlet.jsp.JspException
doEndTag
in interface javax.servlet.jsp.tagext.Tag
doEndTag
in class javax.servlet.jsp.tagext.BodyTagSupport
javax.servlet.jsp.JspException
protected void localRelease()
localRelease
in class AbstractBaseTag
|
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 |