BEA Logo BEA WebLogic Portal Release 4.0

  BEA Home  |  Events  |  Solutions  |  Partners  |  Products  |  Services  |  Download  |  Developer Center  |  WebSUPPORT

 

   WebLogic Portal Documentation   |   Using Webflow and Pipeline   |   Previous Topic   |   Next Topic   |   Contents   |   Index

Webflow JSP Tag Library Reference

 

The WebLogic Portal product suite includes a set of JSP tags designed to facilitate the development of JSPs using Webflow. Use of these predefined tags will eliminate the need for your JSPs to contain any Java code related to Webflow. This topic explains how to import this set of tags into your Web pages, and describes the purpose of each tag.

This topic includes the following sections:

Note: If you are using Webflow in a portal application, you will need to use specialized versions of the Webflow JSP tags. For more information, see Portal Management JSP Tag Library Reference in the Getting Started with Portals and Portlets documentation.

 


Importing the Webflow Tag Library

The Webflow JSP tags are utility tags used to simplify the implementation of JSPs that utilize the Webflow mechanism. To import all of Webflow JSP tags described in this topic, use the following code:

<%@ taglib uri="webflow.tld" prefix="webflow" %>

 


URL Creation Tags

The Webflow's URL tags described in this section are used to create dynamic or static URLs for links and other resources within a JSP.

Note: In the following tables, the Required column specifies if the attribute is required (yes) or optional (no). In the R/C column, C means that the attribute is a Compile time expression, and R means that the attribute can be either a Request time expression or a Compile time expression.

<webflow:createWebflowURL>

The <webflow:createWebflowURL> tag (Table 5-1) is used in a JSP to dynamically create a Webflow URL in a JSP. The Webflow URL may include the protocol, domain name, port, Web application URI, WebflowServlet URI, and query string.

Table 5-1 <webflow:createWebflowURL>

Tag Attribute

Required

Type

Description

R/C

domainName

No

String

Used to change the domain name or IP address of the URL. This may be used if Webflow is fronted by a proxy server and that server resides on another machine.

R

doRedirect

No

String

Causes the WebflowServlet to perform a redirect instead of a forward to a presentation node. Valid values are true and false. The default is false (not to redirect).

R

encode

No

String

Informs Webflow to encode the URL. URLs need to be encoded if you wish to maintain session state and the browser does not accept cookies. Valid values are true and false. The default value is true, as URLs will only need to be encoded if the browser does not accept cookies.

R

event

Yes

String

Webflow will use this in combination with the origin to resolve a destination in the supplied namespace XML file.

R

extraParams

No

String

Used to supply additional request parameters as name/value pairs.

R

httpsInd

No

String

Informs Webflow to calculate the protocol or use HTTPS or HTTP. Therefore, valid values are calculate, http, and https. The default value is http.

Calculate will yield HTTPS if any node in the origin/event branch chain list is matched under the HTTPS_URL_PATTERNS context parameter in the application's WEB-INF/web.xml file. Calculate is more dynamic and expensive, but if the protocol needs to be forced you can specify it here.

R

namespace

No

String

Indicates which Webflow configuration file the origin and event are defined in. If omitted, then the current (last successful) namespace is used.

R

origin

No

String

The node where the event will be coming from. Origins follow the node-name.node-type format. This may or may not be equal to the page name. If omitted, then the JSP page name is used.

R

pathPrefix

No

String

Used to prefix the path information. This string will be placed in front of the Web application URI. This can be used when the proxy server is located on the same machine.

Note: The proxy must strip the path prefix before forwarding the request to Webflow.

R

pathSuffix

No

String

Used to suffix the path information. The additional path information will be placed after the WebflowServlet URI. This information can then be retrieved via the request.getPathInfo() method.

R


 

Example

The following code fragments illustrate how to use the <webflow:createWebflowURL> JSP tag and its many attributes:

<a href="<webflow:createWebflowURL event="link.yo" pathSuffix="/morepath" 
/>">A Path Suffix</a>
<br>
<a href="<webflow:createWebflowURL event="link.yo" pathPrefix="/pathprefix" />">A Path Prefix</a>
<br>
<a href="<webflow:createWebflowURL event="link.yo" pathPrefix="/pathprefix" pathSuffix="/suffix" />">A Path Prefix and Path Suffix</a>
<br>
<a href="<webflow:createWebflowURL event="link.yo" domainName="123.123.123.123" />">A Domain Name</a>
<br>
<a href="<webflow:createWebflowURL event="link.yo" pathSuffix="/morepath" extraParams="sex=male" />">A Path Suffix and One Extra Parameter</a>
<br>
<a href="<webflow:createWebflowURL event="link.yo" pathSuffix="/morepath" extraParams="sex=male&animal=dog" />">A Path Suffix and Two Extra Parameters</a>
<br>
<a href="<webflow:createWebflowURL event="link.yo" httpsInd="https" />">Always Use HTTPS</a>
<br>
<a href="<webflow:createWebflowURL event="link.yo" httpsInd="http" />">Always Use HTTP</a>
<br>
<a href="<webflow:createWebflowURL event="link.yo" httpsInd="calculate" />">Calculate HTTPS</a>
<br>
<a href="<webflow:createWebflowURL event="link.yo" encode="false" />">Do Not Encode the URL</a>
<br>
<a href="<webflow:createWebflowURL event="link.yo" doRedirect="true" />">Redirect, Instead of Forward</a> 
<br>

<webflow:createResourceURL>

The <webflow:createResourceURL> tag (Table 5-2) is used in a JSP to create a static URL for a resource, using the value of the P13N_STATIC_ROOT context parameter in the application's WEB-INF/web.xml file. This tag may be used to load GIF images from a separate server.

Table 5-2 <webflow:createResourceURL>

Tag Attribute

Required

Type

Description

R/C

encode

No

Boolean

Indicates whether or not the URL should be encoded. Valid values are true and false. The default value is true.

R

resource

No

String

Relative path to the file or image.

R


 

Example

The following code fragment illustrates how you might use the <webflow:createResourceURL> JSP tag:

<img src="<webflow:createResourceURL 
resource="/images/button_checkout.gif"/>" border="0" alt="Proceed
To Checkout" border="0"></a>

 


Form Tags

The Webflow JSP form tags described in this section are used to create simple dynamic links for form actions.

Note: In the following tables, the Required column specifies if the attribute is required (yes) or optional (no). In the R/C column, C means that the attribute is a Compile time expression, and R means that the attribute can be either a Request time expression or a Compile time expression.

<webflow:form>

The <webflow:form> tag (Table 5-3) is used in a JSP to dynamically generate an HTML form tag. This tag is not as sophisticated as the <webflow:validatedForm> tag, but is simpler. For more information about the <webflow:validatedForm> tag, refer to the next section.

Note: This tag does not support the embedded Webflow form tags like the <webflow:validatedForm> does.

Table 5-3 <webflow:form>

Tag Attribute

Required

Type

Description

R/C

domainName

No

String

Used to change the domain name or IP address of the URL. This may be used if Webflow is fronted by a proxy server and that server resides on another machine.

R

doRedirect

No

String

Causes the WebflowServlet to perform a redirect instead of a forward to a presentation node. Valid values are true and false. The default is false (not to redirect).

R

encode

No

String

Informs Webflow to encode the URL. URLs need to be encoded if you wish to maintain session state and the browser does not except cookies. Valid values are true and false. The default value is true, as URLs will only need to be encoded if the browser does not except cookies.

R

event

Yes

String

Webflow will use this in combination with the origin to resolve a destination in the supplied namespace XML file.

R

extraParams

No

String

Used to supply additional request parameters as name/value pairs.

R

hide

No

String

If set to false, the namespace, origin, and event will be displayed on the command line instead of as hidden form fields.
Valid values are true and false. The default value is true.

R

httpsInd

No

String

Informs Webflow to calculate the protocol or use HTTPS or HTTP. Therefore, valid values are calculate, http, and https. The default value is http.

Calculate will yield HTTPS if any node in the origin/event branch chain list is matched under the HTTPS_URL_PATTERNS context parameter in the application's WEB-INF/web.xml file. Calculate is more dynamic and expensive, but if the protocol needs to be forced you can specify it here.

R

method

No

String

The method to be used for the form. Valid values are get and post. The default value is post.

R

name

No

String

The name of the form.

R

namespace

No

String

Indicates which Webflow configuration file the origin and event are defined in. If omitted, then the current (last successful) namespace is used.

R

origin

No

String

The node where the event will be coming from. Origins follow the node-name.node-type format. This may or may not be equal to the page name. If omitted, then the JSP page name is used.

R

pathPrefix

No

String

Used to prefix the path information. This string will be placed in front of the Web application URI. This can be used when the proxy server is located on the same machine.

Note: The proxy must strip the path prefix before forwarding the request to Webflow.

R

pathSuffix

No

String

Used to suffix the path information. The additional path information will be placed after the WebflowServlet URI. This information can then be retrieved via the request.getPathInfo() method.

R


 

Example

The following code fragment illustrates how you might use the <webflow:form> JSP tag:

<webflow:form event="button.go" > 
<input type="text" name="username" >
</webflow:form>

 


Validated Form Tags

The Webflow's validated form JSP tags are used to dynamically generate HTML forms that can be validated. These tags work in conjunction with an Input Processor and the ValidatedValues class, described in Webflow Validators and Input Processors. When a Web site visitor enters invalid information, the the visitor's input is preserved and redisplayed with an appropriate error message.

<webflow:validatedForm>

The <webflow:validatedForm> tag (Table 5-4) is used in a JSP to dynamically create the URL that defines the action in an HTML form. This tag should be used in conjunction with the com.bea.p13n.appflow.webflow.forms.* package and the other nested form tags defined in the webflow.tld file (which are described later in this section).

Table 5-4 <webflow:validatedForm>

Tag Attribute

Required

Type

Description

R/C

applyStyle

No

String

Applies the associated style as indicated by the field status to the message, the field, or to none. Therefore, valid values are message, field, and none. The default value is message.

R

domainName

No

String

Used to change the domain name or IP address of the URL. This may be used if Webflow is fronted by a proxy server and that server resides on another machine.

R

doRedirect

No

String

Causes the WebflowServlet to perform a redirect instead of a forward to a presentation node. Valid values are true and false. The default is false (not to redirect).

R

encode

No

String

Informs Webflow to encode the URL. URLs need to be encoded if you wish to maintain session state and the browser does not accept cookies. Valid values are true and false. The default value is true, as URLs will only need to be encoded if the browser does not accept cookies.

R

event

Yes

String

Webflow will use this in combination with the origin to resolve a destination in the supplied namespace XML file.

R

extraParams

No

String

Used to supply additional request parameters as name/value pairs.

R

hide

No

String

If set to false, the namespace, origin, and event will be displayed on the command line instead of as hidden form fields.
Valid values are true and false. The default value is true.

R

httpsInd

No

String

Informs Webflow to calculate the protocol or use HTTPS or HTTP. Therefore, valid values are calculate, http, and https. The default value is http.

Calculate will yield HTTPS if any node in the origin/event branch chain list is matched under the HTTPS_URL_PATTERNS context parameter in the application's WEB-INF/web.xml file. Calculate is more dynamic and expensive, but if the protocol needs to be forced you can specify it here.

R

invalidStyle

No

String

The style used to format the HTML field or the message when the field is invalid.

R

messageAlign

No

String

Indicates whether to align the error message above the field, to the right of the field, or below the field. Therefore, value values are top, right, and bottom. The default value is right.

R

method

No

String

The method to be used for the form. Valid values are get and post. The default value is post.

R

name

No

String

The name of the form.

R

namespace

No

String

Indicates which Webflow configuration file the origin and event are defined in. If omitted, then the current (last successful) namespace is used.

R

origin

No

String

The node where the event will be coming from. Origins follow the node-name.node-type format. This may or may not be equal to the page name. If omitted, then the JSP page name is used.

R

pathPrefix

No

String

Used to prefix the path information. This string will be placed in front of the Web application URI. This can be used when the proxy server is located on the same machine.

Note: The proxy must strip the path prefix before forwarding the request to Webflow.

R

pathSuffix

No

String

Used to suffix the path information. The additional path information will be placed after the WebflowServlet URI. This information can then be retrieved via the request.getPathInfo() method.

R

styleId

No

String

Scripting variable that will be set to one of invalidStyle, unSpecifiedStyle, or validStyle, depending on the field's status: valid, invalid, unspecified. Can be used for finer control of formatting the HTML form.

R

unspecifiedStyle

No

String

Used to specify the intial style of the HTML field before validation occurs.

R

validStyle

No

String

The style used to format the HTML field when it is valid.

R


 

<webflow:text>

The <webflow:text> tag (Table 5-5) is used in a JSP to validate an HTML text field. This tag must be nested in the <webflow:validatedForm> tag.

Table 5-5 <webflow:text>

Tag Attribute

Required

Type

Description

R/C

htmlAttributes

No

String

Additional HTML attributes. Any attribute not supported directly can be supplied here.

R

maxlength

No

String

The maximum length of the text field.

R

name

Yes

String

The name of the text field.

R

retainValue

No

String

Determines whether or not the text field should retain its input upon redisplay. Valid values are true and false.

R

size

No

String

The size of the text field.

R

style

No

String

The HTML style associated with the text field.

R

value

No

String

The initial value of the text field.

R


 

<webflow:password>

The <webflow:password> tag (Table 5-6) is similar to the <webflow:text> tag except that field input is masked with asterisks (****). This tag must be nested in the <webflow:validatedForm> tag.

Table 5-6 <webflow:password>

Tag Attribute

Required

Type

Description

R/C

htmlAttributes

No

String

Additional HTML attributes. Any attribute not supported directly can be supplied here.

R

maxlength

No

String

The maximum length of the password field.

R

name

Yes

String

The name of the password field.

R

retainValue

No

String

Determines whether or not the password field should retain its input upon redisplay. Valid values are true and false. The default value is false.

R

size

No

String

The size of the password field.

R

style

No

String

The HTML style associated with the password field.

R

value

No

String

The initial value of the password field.

R


 

<webflow:radio>

The <webflow:radio> tag (Table 5-7) is used in a JSP to represent an HTML radio button, but preserves the input. This tag must be nested in the <webflow:validatedForm> tag.

Table 5-7 <webflow:radio>

Tag Attribute

Required

Type

Description

R/C

checked

No

String

Determines whether or not the radio button is initially selected. Valid values are true and false. The default value is false.

R

htmlAttributes

No

String

Additional HTML attributes. Any attribute not supported directly can be supplied here.

R

name

Yes

String

The name of the radio button field.

R

value

Yes

String

The initial value of the radio button field.

R


 

<webflow:checkbox>

The <webflow:checkbox> tag (Table 5-8) is used in a JSP to generate the required HTML for a check box. This tag will preserve input upon the InputProcessor throwing an InvalidFormFieldException. This tag must be nested in the <webflow:validatedForm> tag.

Table 5-8 <webflow:checkbox>

Tag Attribute

Required

Type

Description

R/C

checked

No

String

Determines whether or not the check box field is initially selected. Valid values are true and false. The default value is false.

R

htmlAttributes

No

String

Additional HTML attributes. Any attribute not supported directly can be supplied here.

R

name

Yes

String

The name of the check box field.

R

value

Yes

String

The initial value of the check box field.

R


 

<webflow:textarea>

The <webflow:textarea> tag (Table 5-9) is used in a JSP to represent an HTML text area, but preserves the input. This tag must be nested in the <webflow:validatedForm> tag.

Table 5-9 <webflow:textarea>

Tag Attribute

Required

Type

Description

R/C

cols

No

String

The number of columns for the text area.

R

name

Yes

String

The name of the text area.

R

retainValue

No

String

Determines whether or not the text area should retain its input upon redisplay. Valid values are true and false.

R

rows

No

String

The number of rows for the text area.

R

style

No

String

The HTML style associated with the text area.

R

value

No

String

The initial value of the text area.

R

wrap

No

String

Determines whether or not the text area should wrap input. Valid values are true and false. The default value is true.

R

<webflow:select>

The <webflow:select> tag (Table 5-10) is used in a JSP to represent a list box, but preserves its input. This tag must be nested in the <webflow:validatedForm> tag

Table 5-10 <webflow:select>

Tag Attribute

Required

Type

Description

R/C

htmlAttributes

No

String

Additional HTML attributes. Any attribute not supported directly can be supplied here.

R

multiple

No

String

Determines whether or not the list box allows multiple selections. Valid values are true and false. The default value is false.

R

name

Yes

String

The name of the list box.

R

size

No

String

The size of the list box.

R

style

No

String

The HTML style attribute.

R

.

<webflow:option>

The <webflow:option> tag (Table 5-11) is used in a JSP to represent an HTML option, but preserves the input. An option is one value in a list box. This tag must be nested in the <webflow:select> tag

Table 5-11 <webflow:option>

Tag Attribute

Required

Type

Description

R/C

selected

No

String

Determines whether or not the option is initially selected. Valid values are true and false. The default value is false.

R

style

No

String

The HTML style attribute.

R

value

Yes

String

The value the option represents.

R

.

Example

The following code uses each of the validated form tags in an HTML form page that gathers some information about a Web site's visitors.

<%@ taglib uri="webflow.tld" prefix="webflow" %>
<% String validStyle="background: white; color: black; font-family: Arial"; %> 
<% String invalidStyle="background: white; color: red; font-style: italic"; %>
<%-- If there was an InvalidFormDataException thrown, display the message --%> 
<font size="5" color="green"><webflow:getException/></font> 
<br>
<webflow:validatedForm event="button.go" applyStyle="message" 
messageAlign="right" validStyle="<%=validStyle%>"
invalidStyle="<%=invalidStyle%>" unspecifiedStyle="<%=validStyle%>" >
<p>
Username: 
<webflow:text name="username" value="start" size="15" maxlength="30"
htmlAttributes="onMouseOver=\\"self.status='User ID';return true\\"" />
<br>
Password: 
<webflow:password name="password" size="15" retainValue="true" maxlength="30"
htmlAttributes="onMouseOver=\\"self.status='Secret Password';return true\\"" />
<br>
Sex: 
<webflow:radio name="sex" checked="true" value="M"/>Male
<webflow:radio name="sex" value="F" />Female
<br>
Favorite Pet(s):
<webflow:checkbox name="cat" value="cat" />Cat <br>
<webflow:checkbox name="dog" checked="true" value="dog" />Dog <br>
<webflow:checkbox name="bird" value="bird" />Bird
<p>
Comment:
<webflow:textarea name="comment" cols="20" rows="3" value="hello" />
<br>
Hobbies:
<webflow:select name="hobbies" size="3" multiple="true">
<webflow:option value="Running"/>Running
<webflow:option value="Skiing"/>Skiing
<webflow:option value="Motocross"/>MotoX
<webflow:option value="Rugby"/>Rugby
</webflow:select>
<br>
<input type="submit" name="Submit"/> 
</webflow:validatedForm> 

 


Pipeline Session Tags

A Pipeline Session is used to share information between Input Processors, Pipeline Components, and presentation nodes. The Pipeline Session JSP tags are used to retrieve and set properties in the Pipeline Session. Presentation nodes (such as JSPs) are typically used to retrieve information from the Pipeline Session, while Input Processors and Pipeline Components place properties into the Pipeline Session. There are, however, JSP tags for setting properties in the Pipeline Session.

Note: For more information about the Pipeline Session, see The Pipeline Session and Pipeline Session Internals.

<webflow:setProperty>

The <webflow:setProperty> tag (Table 5-12) sets a property in the Pipeline Session.

Table 5-12 <webflow:setProperty>

Tag Attribute

Required

Type

Description

R/C

namespace

No

String

Use the namespace attribute to force webflow to use a particular webflow configuration file defining a specific origin and event. If omitted then the current namespace (last successful namespace) is used.

R

property

Yes

String

Name or key with which the given property is to be associated.

R

scope

No

String

The scope of the property. Valid values are session and request. The default value is session.

R

value

Yes

Object

The value to associate with the property, specified as an object name or JavaScript expression.

R


 

Example

The following code fragment illustrates how you might use the <webflow:setProperty> JSP tag to set some arbitrary object in the Pipeline Session (Request-scoped):

<% SomeObject so = new SomeObject("TWO"); %>
<webflow:setProperty property="myobject" value="<%= so %>" scope="request" />

<webflow:getProperty>

The <webflow:getProperty> tag (Table 5-13) retrieves a named property from the Pipeline Session. This tag can be inlined or return a scripting variable.

Table 5-13 <webflow:getProperty>

Tag Attribute

Required

Type

Description

R/C

namespace

No

String

Use the namespace attribute to force webflow to use a particular webflow configuration file defining a specific origin and event. If omitted then the current namespace (last successful namespace) is used.

R

id

No

Object

Java scripting variable to receive the instance of the returned object. If omitted, the toString() method will be called on the object and the results will be displayed in the browser.

R

property

Yes

String

The name or key of the property to obtain from the Pipeline Session.

R

scope

No

String

The scope of the property, which can be request or session. Request-scoped properties can improve performance, especially in a cluster because they do not need to be replicated. Valid values are session and request. The default value is session.

R

type

Yes

String

A Java class name, which can be used to cast your exception.

R


 

Example 1

The following code fragment is an example of how you might use the <webflow:getProperty> JSP tag inline. The toString() method is called on the instance of SomeObject:

result = <webflow:getProperty property="myobject" scope="request" /> 

Example 2

The following code fragment is an example of how you might use the <webflow:getProperty> JSP tag to return a scripting variable of type SomeObject:

<webflow:getProperty id="myObj" property="myobject" type="com.bea.test.SomeObject" scope="request" /> 
result = <%= myObj.getValue() %>

<webflow:setValidatedValue>

The <webflow:setValidatedValue> tag (Table 5-14) is used in a JSP to configure the display of fields in a form that a Web site visitor must correct. Usually this is done within an Input Processor, but it can also be done from a JSP by using this tag. The <webflow:setValidatedValue> tag is used in tandem with the <webflow:getValidatedValue> tag.

Note: You may want to consider using the <webflow:validatedForm> tags instead. This tag supports the validatedValues class from previous releases. However, if there is some low-level functionality that needs to be accessed, then these tags are still valid.

Table 5-14 <webflow:setValidatedValue>

Tag Attribute

Required

Type

Description

R/C

fieldName

No

String

The name of the field for which the status is desired. This should match the HTML form field name.

R

fieldStatus

No

String

The processing status of the field. Valid values are:
unspecified—Field was left blank; Web site visitor must enter some data.
invalid—Data is entered incorrectly.
valid—Data is entered correctly.

R

fieldValue

No

String

The new value of the field.

R


 

Example

When used in a JSP, this sample code will obtain the current value and processing status of the <field_name> form field.

<webflow:setValidatedValue fieldName="<field_name>" fieldValue="<field_value>" fieldStatus="status" />

<webflow:getValidatedValue>

The <webflow:getValidatedValue> tag (Table 5-15) is used in a JSP to display the fields in a form that a Web site visitor must correct. The <webflow:getValidatedValue> tag is used in tandem with the<webflow:setValidatedValue> tag.

Note: You may want to consider using the <webflow:validatedForm> tags instead. This tag supports the ValidatedValues class from previous releases. However, if there is some low-level functionality that needs to be accessed, then these tags are still valid.

Table 5-15 <webflow:getValidatedValue>

Tag Attribute

Required

Type

Description

R/C

fieldColor

No

String

Scripting variable set to one of invalidColor, validColor, or unspecifiedColor (depending on the status). This can be used to change the color of the field or message.

R

fieldDefaultValue

No

String

The default value to use if the fieldValue is missing.

R

fieldMessage

No

String

A scripting variable used to provide a specific message for the current field.

R

fieldName

Yes

String

The name of the field for which the status is desired. This should match the HTML form field name.

R

fieldStatus

Yes

String

The status of the field. Valid values are:
unspecified—Field was left blank; Web site visitor must enter some data.
invalid—Data is entered incorrectly.
valid—Data is entered correctly.

R

fieldValue

Yes

String

Scripting variable representing the value of the form field.

R

invalidColor

No

String

The color with which the label for an invalid field is to be marked. Defaults to red.

R

unspecified
Color

No

String

If the Web site visitor leaves a required field blank, this will be the color of the label for that field. Defaults to red.

R

validColor

No

String

The color with which the label for a valid field is to be marked. Defaults to black.

R


 

These fields are determined and marked by an Input Processor after performing its validation activities. All InputProcessors use a ValidatedValues object to communicate which fields were successfully processed as well as those that were determined to be invalid. For more information, see Webflow Validators and Input Processors.

Example 1

When used in a JSP, this sample code will obtain the current value and processing status of the <field_name> form field.

<webflow:getValidatedValue fieldName="<field_name>" fieldValue="<field_value>" fieldStatus="status" />

Example 2

The <webflow:getValidatedValue> tag refers to the webflow.tld tag library to retrieve available elements/attributes. In this example, a request is being made to obtain the following values from the HTTP session:

fieldName
fieldValue
fieldStatus
validColor
invalidColor
unspecifiedColor
fieldColor

These attributes are used for display purposes. (In this case, indicate that this field is required and mark it in red.) The overall goal is to display values back to the Web site visitor, indicating which pieces are valid/invalid as returned from the Input Processor.

<webflow:getValidatedValue
fieldName="<%=HttpRequestConstants.CUSTOMER_FIRST_NAME%>"
fieldValue="customerFirstName" fieldStatus="status" validColor="black"
invalidColor="red" unspecifiedColor="black" fieldColor="fontColor"
/>

<webflow:getException>

The <webflow:getException> tag (Table 5-16) is used to retrieve the exception or message thrown by a Webflow processor. This can be the message associated with an InvalidFormFieldException exception or a ProcessingException exception. This tag can be inlined (in which it calls the getMessage() method on the exception) or return a scripting variable representing the exception.

Table 5-16 <webflow:getException>

Tag Attribute

Required

Type

Description

R/C

id

No

Exception

Java scripting variable, which can be used to retrieve an instance of the exception.

R

type

No

String

Java class name, which can be used to cast the exception.

R


 

Example

The following code fragment illustrates how you might use the <webflow:getException> JSP tag:

<%-- If there was an InvalidFormDataException thrown, display the message --%>

<font size="5" color="red"><webflow:getException/></font>

 

back to top previous page next page