BEA NetUI tags and APIs are included for backward compatibility only. For new applications, use the Beehive tags and APIs.

com.bea.wlw.netui.tags.databinding.pageinput
Class DeclarePageInput

java.lang.Object
  extended by javax.servlet.jsp.tagext.TagSupport
      extended by javax.servlet.jsp.tagext.BodyTagSupport
          extended by com.bea.wlw.netui.tags.AbstractBaseTag
              extended by com.bea.wlw.netui.tags.databinding.pageinput.DeclarePageInput
All Implemented Interfaces:
HtmlConstants, Serializable, javax.servlet.jsp.tagext.BodyTag, javax.servlet.jsp.tagext.IterationTag, javax.servlet.jsp.tagext.JspTag, javax.servlet.jsp.tagext.Tag

public class DeclarePageInput
extends AbstractBaseTag

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
AttributeRequiredRuntime Expression EvaluationData Bindable
nameYesNoNo
The name of a variable that can be referenced in the page input data binding context.
typeYesNoNo
The type of the variable referenced in the page input data binding context.

See Also:
Serialized Form
Example:
This sample shows how a variable, 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.

Code in the Controller file...

    /**
    * @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;
        }
    }

Code in a JSP page...

    <netui-data:declarePageInput name="fooBean" type="pageInput.PageInputController.FooBean"/>
    ...
    fooBean.foo: <netui:label value="{pageInput.fooBean.foo}" />

Code Sample

[BEA_HOME]/weblogic81/samples/workshop/SamplesApp/WebApp/tagSamples/netui_databinding/declarePageInput/
Beadoc.see:
<netui-data:declarePageInput> Tag Sample
Beadoc.tagdescription:

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 com.bea.wlw.netui.tags.AbstractBaseTag
addTagIdMapping, containsExpression, evaluateAttributeToString, evaluateExpression, filter, filter, formatErrorString, formatString, getAttribute, getErrorsReport, getExpressionEvaluator, getJavaScriptUtils, getNearestForm, getNextId, getQualifiedBundleName, getScriptReporter, getUserLocale, hasErrors, isExpression, prepForRendering, registerAttribute, registerError, registerTagError, release, removeAttribute, renderAttribute, renderAttributes, reportErrors, rewriteName, setPageContext, updateExpression, write
 
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

DeclarePageInput

public DeclarePageInput()
Method Detail

setName

public void setName(String name)
Set the name of a variable that can be referecned using the page input data binding context.

Parameters:
name - the name of the variable
Beadoc.attributedescription:
The name of the variable to reference.
Beadoc.attributesyntaxvalue:
string_name
Beadoc.databindable:
false

getName

public String getName()
Get the name of the variable that can be referenced using the page input data binding context.


setType

public void setType(String type)
Set the type of the variable that referenced with the

Parameters:
type - the type of the variable that is referenced
Beadoc.attributedescription:
The expected data type of the variable.
Beadoc.attributesyntaxvalue:
string_type
Beadoc.databindable:
false

getType

public String getType()
Get the type of the variable that referenced with the


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 class AbstractBaseTag
Returns:
a constant String representing the name of this tag.

doStartTag

public int doStartTag()
Specified by:
doStartTag in interface javax.servlet.jsp.tagext.Tag
Overrides:
doStartTag in class javax.servlet.jsp.tagext.BodyTagSupport
Returns:
SKIP_BODY as this tag does not evaluate its body

doEndTag

public int doEndTag()
             throws javax.servlet.jsp.JspException
Specified by:
doEndTag in interface javax.servlet.jsp.tagext.Tag
Overrides:
doEndTag in class javax.servlet.jsp.tagext.BodyTagSupport
Returns:
EVAL_PAGE as this tag always continues to evaluate the page
Throws:
javax.servlet.jsp.JspException

localRelease

protected void localRelease()
Reset all of the fields of this tag.

Overrides:
localRelease in class AbstractBaseTag

BEA NetUI tags and APIs are included for backward compatibility only. For new applications, use the Beehive tags and APIs.