bea.com | products | dev2dev | support | askBEA
 Download Docs   Site Map   Glossary 
Search

JavaServer Page Guide

 Previous Next Contents View as PDF  

Portal and Portlet Management JSP Tags

WebLogic Portal includes a set of JSP tags designed to facilitate the development of portals and portlets. Use these predefined tags to reduce the amount of Java code required in your JSP page. This topic explains how to import each set of tags into your Web pages, and describes the purpose of each tag.

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.

This topic includes the following sections:

 


Portlet Tag Libraries

The following section describes the portlet tags and their attributes.

<portlet:createWebflowURL>

Tag Library

portlet.tld

Import Statement

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

Classes Implemented

CreatePortletURLTag

CreateWebflowURLTagExtraInfo


 

The <portlet:createWebflowURL> tag is used in a portlet 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  2-1 describes the <portlet:createWebflowURL> tag attributes.

Table 2-1 <portlet:createWebflowURL> Tag Attributes

Tag Attribute

Required

Type

Description

R/C

pageName

No

String

The page from which the event is generated.

R

portletName

No

String

The relevant portlet ID. This is usually automatically generated, but can be modified.

R

portletNamespace

No

String

Webflow namespace in which the event will be invoked. This does not need to be the default Webflow namespace for the portlet.

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

event

Yes

String

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

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

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

extraParams

No

String

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

R

doRedirect

No

String

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

C

httpsInd

No

String

Informs Webflow to calculate the protocol or use HTTPS or HTTP. Valid values are calculate, http, and https.

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.

If a value is not set for this attribute, the context-param value for HTTPSIND_DEFAULT_VALUE in web.xml is used. If no value is found there, calculate is used.

If an invalid value is used for this attribute, calculate is used.

The following example shows a protocol set in web.xml. This value would be used if no JSP tag attribute is set.

<context-param>
<param-name>HTTPSIND_DEFAULT_VALUE</param-name>
<param-value>HTTPS</param-value>
</context-param>

The possible values of HTTP, HTTPS or CALCULATE can be specified in all uppercase or all lowercase.

C

escape

No

String

Tells Weblfow to escape the URL. URLs must be escaped if they will contain any characters (with some exceptions - see below) that would be encoded using java.net.URLEncoder.encode(). Note however that even when escaping is on the entire URL is not encoded rather the URL will be tokenized using the characters ':', '/', '?', '=', and '&' then the substrings between the tokens are encoded using java.net.URLEncoder.encode(). The tokenizing is necessary so that the URL will still be recognized by the Webflow engine.

Valid values for this attribute are 'NO', 'YES' or 'CALCULATE'.

Escaping is relatively costly and should be avoided if possible but is required if the URL might have any characters other then those ignored by java.net.URLEncoder.encode(), that is any characters other than 'a' through 'z', 'A' through 'Z, '0' through '9', '-', '_', '.', or '*' with the exception of the tokenizing characters mentioned above. If the content of the URL will not be determined until runtime and might contain "illegal" characters you should use either 'YES' or 'CALCULATE'. 'CALCULATE' should be used with care.


escape (con't)

No

String

(Continued from previous page)

For sites that have a small number of URLs that will need escaping using 'CALCULATE' rather then 'YES' will result in a performance improvement. But, since 'CALCULATE' first checks the URL then encodes if needed, sites where most URLs need escaping will have poorer performance using 'CALCULATE' rather then 'YES'.

If omitted the default value for escaping is determined by the value of ESCAPE_URLS in the web app's web.xml file. See "Encoding Webflow URLs" for more information.


encode

No

String

Tells 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 determined by the value of ENCODE_URLS set in the web app's web.xml file. URLs will only need to be encoded if the browser does not accept cookies. See "Encoding Webflow URLs" for more information.

C

Example

Listing  2-1 illustrates how to use the <portlet:createWebflowURL> JSP tag.

Listing 2-1 Using <portlet:createWebflow>

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

<center>
<font size="6" color="green">Portlet 2 - Page 1</font><BR>
<p>
<p>
Portlet Webflow Test:
<p>
<a href="<portlet:createWebflowURL event="switch"/>">Next Page</a>
<p>
</center>

<portlet:form>

Tag Library

portlet.tld

Import Statement

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

Classes Implemented

PortletFormTag


 

The <portlet:form> tag is used in a JSP to dynamically generate an HTML form tag. This tag is not as sophisticated as the <portlet:validatedForm> tag, but is simpler. See <portlet:validatedForm> tag for more information.

Table  2-2 describes the <portlet:form> tag attributes.

Table 2-2 <portlet:form> Tag Attributes

Tag Attribute

Required

Type

Description

R/C

pageName

No

String

The page from which the event is generated.

R

portletName

No

String

The relevant portlet ID. This is usually automatically generated, but can be modified.

R

portletNamespace

No

String

Webflow namespace in which the event will be invoked. This does not need to be the default Webflow namespace for the portlet.

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

event

yes

String

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

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

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

extraParams

No

String

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

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).

C

httpsInd

No

String

Informs Webflow to calculate the protocol or use HTTPS or HTTP. Valid values are calculate, http, and https.

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.

If a value is not set for this attribute, the context-param value for HTTPSIND_DEFAULT_VALUE in web.xml is used. If no value is found there, calculate is used.

If an invalid value is used for this attribute, calculate is used.

The following example shows a protocol set in web.xml. This value would be used if no JSP tag attribute is set.

<context-param>
<param-name>HTTPSIND_DEFAULT_VALUE</param-name>
<param-value>HTTPS</param-value>
</context-param>

The possible values of HTTP, HTTPS or CALCULATE can be specified in all uppercase or all lowercase.

C

escape

No

String

Tells Weblfow to escape the URL. URLs must be escaped if they will contain any characters (with some exceptions - see below) that would be encoded using java.net.URLEncoder.encode(). Note however that even when escaping is on the entire URL is not encoded rather the URL will be tokenized using the characters ':', '/', '?', '=', and '&' then the substrings between the tokens are encoded using java.net.URLEncoder.encode(). The tokenizing is necessary so that the URL will still be recognized by the Webflow engine.

Valid values for this attribute are 'NO', 'YES' or 'CALCULATE'.

Escaping is relatively costly and should be avoided if possible but is required if the URL might have any characters other then those ignored by java.net.URLEncoder.encode(), that is any characters other than 'a' through 'z', 'A' through 'Z, '0' through '9', '-', '_', '.', or '*' with the exception of the tokenizing characters mentioned above. If the content of the URL will not be determined until runtime and might contain "illegal" characters you should use either 'YES' or 'CALCULATE'. 'CALCULATE' should be used with care.


escape (con't)

No

String

(Continued from previous page)

For sites that have a small number of URLs that will need escaping using 'CALCULATE' rather then 'YES' will result in a performance improvement. But, since 'CALCULATE' first checks the URL then encodes if needed, sites where most URLs need escaping will have poorer performance using 'CALCULATE' rather then 'YES'.

If omitted the default value for escaping is determined by the value of ESCAPE_URLS in the web app's web.xml file. See "Encoding Webflow URLs" for more information.


encode

No

String

Tells 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 determined by the value of ENCODE_URLS set in the web app's web.xml file. URLs will only need to be encoded if the browser does not accept cookies. See "Encoding Webflow URLs" for more information..

C

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.

C

method

No

String

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

C

name

No

String

The name of the form.

C

htmlAttributes

No

String

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

R

<portlet:validatedForm>

Tag Library

portlet.tld

Import Statement

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

Classes Implemented

PortletValidatedFormTag

WebflowValidatedFormTagExtraInfo


 

The <portlet:validatedForm> tag is used to dynamically generate HTML forms that can be validated. When a Web site visitor enters invalid information, the visitor's input is preserved and redisplayed with an appropriate error message.

Table  2-3 describes the <portlet:ValidatedForm> tag attributes.

Table 2-3 <portlet:validatedForm>  Tag Attributes

Tag Attribute

Required

Type

Description

R/C

pageName

No

String

The page from which the validated form URL is generated

R

portletName

No

String

The relevant portlet ID. This is usually automatically generated, but can be modified.

R

portletNamespace

No

String

Webflow namespace in which the event will be invoked. This does not need to be the default Webflow namespace for the portlet.

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

event

yes

String

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

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

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

extraParams

No

String

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

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).

C

httpsInd

No

String

Informs Webflow to calculate the protocol or use HTTPS or HTTP. Valid values are calculate, http, and https.

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.

If a value is not set for this attribute, the context-param value for HTTPSIND_DEFAULT_VALUE in web.xml is used. If no value is found there, calculate is used.

If an invalid value is used for this attribute, calculate is used.

The following example shows a protocol set in web.xml. This value would be used if no JSP tag attribute is set.

<context-param>
<param-name>HTTPSIND_DEFAULT_VALUE</param-name>
<param-value>HTTPS</param-value>
</context-param>

The possible values of HTTP, HTTPS or CALCULATE can be specified in all uppercase or all lowercase.

C

escape

No

String

Tells Weblfow to escape the URL. URLs must be escaped if they will contain any characters (with some exceptions - see below) that would be encoded using java.net.URLEncoder.encode(). Note however that even when escaping is on the entire URL is not encoded rather the URL will be tokenized using the characters ':', '/', '?', '=', and '&' then the substrings between the tokens are encoded using java.net.URLEncoder.encode(). The tokenizing is necessary so that the URL will still be recognized by the Webflow engine.

Valid values for this attribute are 'NO', 'YES' or 'CALCULATE'.

Escaping is relatively costly and should be avoided if possible but is required if the URL might have any characters other then those ignored by java.net.URLEncoder.encode(), that is any characters other than 'a' through 'z', 'A' through 'Z, '0' through '9', '-', '_', '.', or '*' with the exception of the tokenizing characters mentioned above. If the content of the URL will not be determined until runtime and might contain "illegal" characters you should use either 'YES' or 'CALCULATE'. 'CALCULATE' should be used with care.


escape (con't)

No

String

(Continued from previous page)

For sites that have a small number of URLs that will need escaping using 'CALCULATE' rather then 'YES' will result in a performance improvement. But, since 'CALCULATE' first checks the URL then encodes if needed, sites where most URLs need escaping will have poorer performance using 'CALCULATE' rather then 'YES'.

If omitted the default value for escaping is determined by the value of ESCAPE_URLS in the web app's web.xml file. See "Encoding Webflow URLs" for more information.


encode

No

String

Tells 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 determined by the value of ENCODE_URLS set in the web app's web.xml file. URLs will only need to be encoded if the browser does not accept cookies. See "Encoding Webflow URLs" for more information.

C

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.

C

method

No

String

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

C

name

No

String

The name of the form.

C

validStyle

No

String

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

R

invalidStyle

No

String

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

R

unspecifiedStyle

No

String

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

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

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.

C

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.

C

htmlAttributes

No

String

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

R

Example

The following code sample illustrates how to use the <portlet:validatedForm> JSP tag:

Listing 2-2 Using <portlet:validatedForm>

<%@ taglib uri="portlet.tld" prefix="portlet" %>
<%@ taglib uri="webflow.tld" prefix="webflow" %>
<center>
<% String validStyle="color: black; font-family: Arial"; %>
<% String invalidStyle="color: darkred; font-style: Arial"; %>
<%-- If there was an InvalidFormDataException thrown display the message --%>
<font size="3" color="darkred"><portlet:getException/></font>
<br>
<webflow:getProperty id="welcomeStr" property="WELCOME_STRING"
type="java.lang.String" scope="request" namespace="portlet3"/>
<% if (welcomeStr == null || welcomeStr.length() < 1)
{
%>
<portlet:validatedForm event="button.go" applyStyle="message" messageAlign="right"
validStyle="<%=validStyle%>" invalidStyle="<%=invalidStyle%>"
unspecifiedStyle="<%=validStyle%>" >
<p>
Welcome :
<webflow:text name="welcome" value="Hello" size="15" maxlength="30" /> <br>
<input type="submit" name="Submit"/> </portlet:validatedForm>
<br>
<%
}
else
{
%>
<font size="5" color="green"><%= welcomeStr %></font>
<%
}
%>
</center>
<p>

<portlet:createPortletEditURL>

Tag Library

portlet.tld

Import Statement

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

Classes Implemented

CreateEditURLTag


 

The <portlet:createPortletEditURL> tag generates a webflow URL that represents editing a portlet.

Table 2-4 <portlet:createPortletEditURL> Tag Attributes

Tag Attribute

Required

Type

Description

R/C

pageName

No

String

The page from which the edit URL is generated.

R

portletName

No

String

The relevant portlet ID. This is usually automatically generated, but can be modified.

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

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

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

extraParams

No

String

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

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

httpsInd

No

String

Informs Webflow to calculate the protocol or use HTTPS or HTTP. Valid values are calculate, http, and https.

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.

If a value is not set for this attribute, the context-param value for HTTPSIND_DEFAULT_VALUE in web.xml is used. If no value is found there, calculate is used.

If an invalid value is used for this attribute, calculate is used.

The following example shows a protocol set in web.xml. This value would be used if no JSP tag attribute is set.

<context-param>
<param-name>HTTPSIND_DEFAULT_VALUE</param-name>
<param-value>HTTPS</param-value>
</context-param>

The possible values of HTTP, HTTPS or CALCULATE can be specified in all uppercase or all lowercase.

R

escape

No

String

Tells Weblfow to escape the URL. URLs must be escaped if they will contain any characters (with some exceptions - see below) that would be encoded using java.net.URLEncoder.encode(). Note however that even when escaping is on the entire URL is not encoded rather the URL will be tokenized using the characters ':', '/', '?', '=', and '&' then the substrings between the tokens are encoded using java.net.URLEncoder.encode(). The tokenizing is necessary so that the URL will still be recognized by the Webflow engine.

Valid values for this attribute are 'NO', 'YES' or 'CALCULATE'.

Escaping is relatively costly and should be avoided if possible but is required if the URL might have any characters other then those ignored by java.net.URLEncoder.encode(), that is any characters other than 'a' through 'z', 'A' through 'Z, '0' through '9', '-', '_', '.', or '*' with the exception of the tokenizing characters mentioned above. If the content of the URL will not be determined until runtime and might contain "illegal" characters you should use either 'YES' or 'CALCULATE'. 'CALCULATE' should be used with care.


escape (con't)

No

String

(Continued from previous page)

For sites that have a small number of URLs that will need escaping using 'CALCULATE' rather then 'YES' will result in a performance improvement. But, since 'CALCULATE' first checks the URL then encodes if needed, sites where most URLs need escaping will have poorer performance using 'CALCULATE' rather then 'YES'.

If omitted the default value for escaping is determined by the value of ESCAPE_URLS in the web app's web.xml file. See "Encoding Webflow URLs" for more information..


encode

No

String

Tells 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 determined by the value of ENCODE_URLS set in the web app's web.xml file. URLs will only need to be encoded if the browser does not accept cookies. See "Encoding Webflow URLs" for more information.

R

Table  2-4 describes the <portlet:createPortletEditURL> tag attributes.

Example

Listing  2-3 illustrates how to use the <portlet:createPortletEditURL> JSP tag:

Listing 2-3 Using <portlet:createPortletEditURL>

        }
if (PortletRenderHelper.isEditable(request))
{
%>
<td width="1%" valign="middle"><a href="<portlet:createPortletEditURL httpsInd='http'/>">
<img src="<webflow:createResourceURL resource='<%=imagesPath+"portlet_edit.gif"%>'/>" hspace="1" vspace="2" border="0" alt="Edit" align="absmiddle"></a></td>
<%

<portlet:createPortletUneditURL>

Tag Library

portlet.tld

Import Statement

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

Classes Implemented

CreatePortletUneditURLTag


 

The <createPortletUneditURL> JSP tag generates a webflow URL that represents leaving the edit URL and moving to another page.

Table  2-5 describes the <portlet:createPortletUneditURL> tag attributes.

Table 2-5 <portlet:createPortletUneditURL> Tag Attributes

Tag Attribute

Required

Type

Description

R/C

pageName

No

String

The page from which the unedit URL is generated.

R

portletName

No

String

The portlet ID. This is usually automatically generated, but can be modified.

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

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

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

extraParams

No

String

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

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

httpsInd

No

String

Informs Webflow to calculate the protocol or use HTTPS or HTTP. Valid values are calculate, http, and https.

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.

If a value is not set for this attribute, the context-param value for HTTPSIND_DEFAULT_VALUE in web.xml is used. If no value is found there, calculate is used.

If an invalid value is used for this attribute, calculate is used.

The following example shows a protocol set in web.xml. This value would be used if no JSP tag attribute is set.

<context-param>
<param-name>HTTPSIND_DEFAULT_VALUE</param-name>
<param-value>HTTPS</param-value>
</context-param>

The possible values of HTTP, HTTPS or CALCULATE can be specified in all uppercase or all lowercase.

R

escape

No

String

Tells Weblfow to escape the URL. URLs must be escaped if they will contain any characters (with some exceptions - see below) that would be encoded using java.net.URLEncoder.encode(). Note however that even when escaping is on the entire URL is not encoded rather the URL will be tokenized using the characters ':', '/', '?', '=', and '&' then the substrings between the tokens are encoded using java.net.URLEncoder.encode(). The tokenizing is necessary so that the URL will still be recognized by the Webflow engine.

Valid values for this attribute are 'NO', 'YES' or 'CALCULATE'.

Escaping is relatively costly and should be avoided if possible but is required if the URL might have any characters other then those ignored by java.net.URLEncoder.encode(), that is any characters other than 'a' through 'z', 'A' through 'Z, '0' through '9', '-', '_', '.', or '*' with the exception of the tokenizing characters mentioned above. If the content of the URL will not be determined until runtime and might contain "illegal" characters you should use either 'YES' or 'CALCULATE'. 'CALCULATE' should be used with care.


escape (con't)

No

String

(Continued from previous page)

For sites that have a small number of URLs that will need escaping using 'CALCULATE' rather then 'YES' will result in a performance improvement. But, since 'CALCULATE' first checks the URL then encodes if needed, sites where most URLs need escaping will have poorer performance using 'CALCULATE' rather then 'YES'.

If omitted the default value for escaping is determined by the value of ESCAPE_URLS in the web app's web.xml file. See "Encoding Webflow URLs" for more information.


encode

No

String

Tells 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 determined by the value of ENCODE_URLS set in the web app's web.xml file. URLs will only need to be encoded if the browser does not accept cookies. See "Encoding Webflow URLs" for more information.

R

<portlet:createPortletMinimizeURL>

Tag Library

portlet.tld

Import Statement

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

Classes Implemented

CreatePortletMinimizeURLTag


 

The <portlet:createPortletMinimizeURL> JSP tag generates a webflow URL that represents minimizing a portlet.

Table  2-6 describes the <portlet:createPortletMinimizeURL> tag attributes.

Table 2-6 <portlet:createPortletMinimizeURL> Tag Attributes  

Tag Attribute

Required

Type

Description

R/C

pageName

no

String

The page from which the minimize URL is generated.

R

portletName

No

String

The portlet ID. This is usually automatically generated, but can be modified.

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

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

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

extraParams

No

String

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

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

httpsInd

No

String

Informs Webflow to calculate the protocol or use HTTPS or HTTP. Valid values are calculate, http, and https.

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.

If a value is not set for this attribute, the context-param value for HTTPSIND_DEFAULT_VALUE in web.xml is used. If no value is found there, calculate is used.

If an invalid value is used for this attribute, calculate is used.

The following example shows a protocol set in web.xml. This value would be used if no JSP tag attribute is set.

<context-param>
<param-name>HTTPSIND_DEFAULT_VALUE</param-name>
<param-value>HTTPS</param-value>
</context-param>

The possible values of HTTP, HTTPS or CALCULATE can be specified in all uppercase or all lowercase.

R

escape

No

String

Tells Weblfow to escape the URL. URLs must be escaped if they will contain any characters (with some exceptions - see below) that would be encoded using java.net.URLEncoder.encode(). Note however that even when escaping is on the entire URL is not encoded rather the URL will be tokenized using the characters ':', '/', '?', '=', and '&' then the substrings between the tokens are encoded using java.net.URLEncoder.encode(). The tokenizing is necessary so that the URL will still be recognized by the Webflow engine.

Valid values for this attribute are 'NO', 'YES' or 'CALCULATE'.

Escaping is relatively costly and should be avoided if possible but is required if the URL might have any characters other then those ignored by java.net.URLEncoder.encode(), that is any characters other than 'a' through 'z', 'A' through 'Z, '0' through '9', '-', '_', '.', or '*' with the exception of the tokenizing characters mentioned above. If the content of the URL will not be determined until runtime and might contain "illegal" characters you should use either 'YES' or 'CALCULATE'. 'CALCULATE' should be used with care.


escape (con't)

No

String

(Continued from previous page)

For sites that have a small number of URLs that will need escaping using 'CALCULATE' rather then 'YES' will result in a performance improvement. But, since 'CALCULATE' first checks the URL then encodes if needed, sites where most URLs need escaping will have poorer performance using 'CALCULATE' rather then 'YES'.

If omitted the default value for escaping is determined by the value of ESCAPE_URLS in the web app's web.xml file. See "Encoding Webflow URLs" for more information.


encode

No

String

Tells 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 determined by the value of ENCODE_URLS set in the web app's web.xml file. URLs will only need to be encoded if the browser does not accept cookies. See "Encoding Webflow URLs" for more information.

R

Example

Listing  2-4 illustrates how to use the <portlet:createPortletMinimizeURL> JSP tag:

Listing 2-4 Using <portlet:createPortletMinimizeURL>

        }
if (PortletRenderHelper.isMinimizable(request))
{
%>

<td width="1%" valign="middle"><a href="<portlet:createPortletMinimizeURL httpsInd='http'/>">
<img src="<webflow:createResourceURL resource='<%=imagesPath+"portlet_min.gif"%>'/>" hspace="1" vspace="2" border="0" alt="Minimize" align="absmiddle"></a></td>
<%

<portlet:createPortletUnminimizeURL>

Tag Library

portlet.tld

Import Statement

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

Classes Implemented

CreateUnminimizeURLTag


 

The <portlet:createPortletUnminimizeURL> tag generates a webflow URL that represents unminimizing a portlet.

Table  2-7 describes the <portlet:createPortletUnminimizeURL> tag attributes.

Table 2-7 <portlet:createPortletUnminimizeURL> Tag Attributes  

Tag Attribute

Required

Type

Description

R/C

pageName

no

String

The page from which the unminimize URL is generated.

R

portletName

No

String

The portlet ID. This is usually automatically generated, but can be modified.

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

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

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

extraParams

No

String

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

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

httpsInd

No

String

Informs Webflow to calculate the protocol or use HTTPS or HTTP. Valid values are calculate, http, and https.

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.

If a value is not set for this attribute, the context-param value for HTTPSIND_DEFAULT_VALUE in web.xml is used. If no value is found there, calculate is used.

If an invalid value is used for this attribute, calculate is used.

The following example shows a protocol set in web.xml. This value would be used if no JSP tag attribute is set.

<context-param>
<param-name>HTTPSIND_DEFAULT_VALUE</param-name>
<param-value>HTTPS</param-value>
</context-param>

The possible values of HTTP, HTTPS or CALCULATE can be specified in all uppercase or all lowercase.

R

escape

No

String

Tells Weblfow to escape the URL. URLs must be escaped if they will contain any characters (with some exceptions - see below) that would be encoded using java.net.URLEncoder.encode(). Note however that even when escaping is on the entire URL is not encoded rather the URL will be tokenized using the characters ':', '/', '?', '=', and '&' then the substrings between the tokens are encoded using java.net.URLEncoder.encode(). The tokenizing is necessary so that the URL will still be recognized by the Webflow engine.

Valid values for this attribute are 'NO', 'YES' or 'CALCULATE'.

Escaping is relatively costly and should be avoided if possible but is required if the URL might have any characters other then those ignored by java.net.URLEncoder.encode(), that is any characters other than 'a' through 'z', 'A' through 'Z, '0' through '9', '-', '_', '.', or '*' with the exception of the tokenizing characters mentioned above. If the content of the URL will not be determined until runtime and might contain "illegal" characters you should use either 'YES' or 'CALCULATE'. 'CALCULATE' should be used with care.


escape (con't)

No

String

(Continued from previous page)

For sites that have a small number of URLs that will need escaping using 'CALCULATE' rather then 'YES' will result in a performance improvement. But, since 'CALCULATE' first checks the URL then encodes if needed, sites where most URLs need escaping will have poorer performance using 'CALCULATE' rather then 'YES'.

If omitted the default value for escaping is determined by the value of ESCAPE_URLS in the web app's web.xml file. See "Encoding Webflow URLs" for more information.


encode

No

String

Tells 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 determined by the value of ENCODE_URLS set in the web app's web.xml file. URLs will only need to be encoded if the browser does not accept cookies. See "Encoding Webflow URLs" for more information..

R

Example

Listing  2-5 illustrates how to use the <portlet:createPortletUnminimizeURL> JSP tag:

Listing 2-5 Using <portlet:createPortletUnminimizeURL>

<%--  Create a link to unminimize the portlet --%>
<td width="1%" valign="middle">
<a href="<portlet:createPortletUnminimizeURL/>">
<img src="<webflow:createResourceURL resource=
'<%=imagesPath+"portlet_unmin.gif"%>'/>" hspace="1" vspace="2"
border="0" alt="Restore" align="absmiddle"></a></td>

<portlet:createPortletMaximizeURL>

Tag Library

portlet.tld

Import Statement

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

Classes Implemented

CreateMaximizeURLTag


 

The <portlet:createPortletMaximizeURL> JSP tag generates a webflow URL that represents maximizing a portlet.

Table  2-8 describes the <portlet:createPortletMaximizeURL> tag attributes.

Table 2-8 <portlet:createPortletMaximizeURL> Tag Attributes  

Tag Attribute

Required

Type

Description

R/C

pageName

no

String

The page from which the maximize URL is generated.

R

portletName

No

String

The portlet ID. This is usually automatically generated, but can be modified.

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

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

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

extraParams

No

String

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

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

httpsInd

No

String

Informs Webflow to calculate the protocol or use HTTPS or HTTP. Valid values are calculate, http, and https.

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.

If a value is not set for this attribute, the context-param value for HTTPSIND_DEFAULT_VALUE in web.xml is used. If no value is found there, calculate is used.

If an invalid value is used for this attribute, calculate is used.

The following example shows a protocol set in web.xml. This value would be used if no JSP tag attribute is set.

<context-param>
<param-name>HTTPSIND_DEFAULT_VALUE</param-name>
<param-value>HTTPS</param-value>
</context-param>

The possible values of HTTP, HTTPS or CALCULATE can be specified in all uppercase or all lowercase.

R

escape

No

String

Tells Weblfow to escape the URL. URLs must be escaped if they will contain any characters (with some exceptions - see below) that would be encoded using java.net.URLEncoder.encode(). Note however that even when escaping is on the entire URL is not encoded rather the URL will be tokenized using the characters ':', '/', '?', '=', and '&' then the substrings between the tokens are encoded using java.net.URLEncoder.encode(). The tokenizing is necessary so that the URL will still be recognized by the Webflow engine.

Valid values for this attribute are 'NO', 'YES' or 'CALCULATE'.

Escaping is relatively costly and should be avoided if possible but is required if the URL might have any characters other then those ignored by java.net.URLEncoder.encode(), that is any characters other than 'a' through 'z', 'A' through 'Z, '0' through '9', '-', '_', '.', or '*' with the exception of the tokenizing characters mentioned above. If the content of the URL will not be determined until runtime and might contain "illegal" characters you should use either 'YES' or 'CALCULATE'. 'CALCULATE' should be used with care.


escape (con't)

No

String

(Continued from previous page)

For sites that have a small number of URLs that will need escaping using 'CALCULATE' rather then 'YES' will result in a performance improvement. But, since 'CALCULATE' first checks the URL then encodes if needed, sites where most URLs need escaping will have poorer performance using 'CALCULATE' rather then 'YES'.

If omitted the default value for escaping is determined by the value of ESCAPE_URLS in the web app's web.xml file. See "Encoding Webflow URLs" for more information.


encode

No

String

Tells 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 determined by the value of ENCODE_URLS set in the web app's web.xml file. URLs will only need to be encoded if the browser does not accept cookies. See "Encoding Webflow URLs" for more information..

R

Example

Listing  2-6 illustrates how to use the <portlet:createPortletMaximizeURL> JSP tag:

Listing 2-6 Using <portlet:createPortletMaximizeURL>

<%
}
if (PortletRenderHelper.isMaximizable(request))
{
%>

<td width="1%" valign="middle">
<%-- Create the link to maximize the portlet --%>
<a href="<portlet:createPortletMaximizeURL
httpsInd='http'/>"><img src=
"<webflow:createResourceURL
resource='<%=imagesPath+"portlet_max.
gif"%>'/>" hspace="1" vspace="2" border="0"
alt="Maximize" align="absmiddle"></a></td>
<%

<portlet:createPortletUnmaximizeURL>

Tag Library

portlet.tld

Import Statement

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

Classes Implemented

CreateUnmaximizeURLTag


 

The <portlet:createPortletUnmaximizeURL> JSP Tag generates a webflow URL that represents unmaximizing a portlet.

Table  2-8 describes the <portlet:createPortletUnmaximizeURL> tag attributes.

Table 2-9 <portlet:createPortletUnmaximizeURL>  

Tag Attribute

Required

Type

Description

R/C

pageName

no

String

The page from which the unmaximize URL is generated.

R

portletName

No

String

The portlet ID. This is usually automatically generated, but can be modified.

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

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

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

extraParams

No

String

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

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

httpsInd

No

String

Informs Webflow to calculate the protocol or use HTTPS or HTTP. Valid values are calculate, http, and https.

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.

If a value is not set for this attribute, the context-param value for HTTPSIND_DEFAULT_VALUE in web.xml is used. If no value is found there, calculate is used.

If an invalid value is used for this attribute, calculate is used.

The following example shows a protocol set in web.xml. This value would be used if no JSP tag attribute is set.

<context-param>
<param-name>HTTPSIND_DEFAULT_VALUE</param-name>
<param-value>HTTPS</param-value>
</context-param>

The possible values of HTTP, HTTPS or CALCULATE can be specified in all uppercase or all lowercase.

R

escape

No

String

Tells Weblfow to escape the URL. URLs must be escaped if they will contain any characters (with some exceptions - see below) that would be encoded using java.net.URLEncoder.encode(). Note however that even when escaping is on the entire URL is not encoded rather the URL will be tokenized using the characters ':', '/', '?', '=', and '&' then the substrings between the tokens are encoded using java.net.URLEncoder.encode(). The tokenizing is necessary so that the URL will still be recognized by the Webflow engine.

Valid values for this attribute are 'NO', 'YES' or 'CALCULATE'.

Escaping is relatively costly and should be avoided if possible but is required if the URL might have any characters other then those ignored by java.net.URLEncoder.encode(), that is any characters other than 'a' through 'z', 'A' through 'Z, '0' through '9', '-', '_', '.', or '*' with the exception of the tokenizing characters mentioned above. If the content of the URL will not be determined until runtime and might contain "illegal" characters you should use either 'YES' or 'CALCULATE'. 'CALCULATE' should be used with care.


escape (con't)

No

String

(Continued from previous page)

For sites that have a small number of URLs that will need escaping using 'CALCULATE' rather then 'YES' will result in a performance improvement. But, since 'CALCULATE' first checks the URL then encodes if needed, sites where most URLs need escaping will have poorer performance using 'CALCULATE' rather then 'YES'.

If omitted the default value for escaping is determined by the value of ESCAPE_URLS in the web app's web.xml file. See "Encoding Webflow URLs" for more information.


encode

No

String

Tells 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 determined by the value of ENCODE_URLS set in the web app's web.xml file. URLs will only need to be encoded if the browser does not accept cookies. See "Encoding Webflow URLs" for more information.

R


 

Example

The following code sample illustrates how to use the <portal:createPortletUnamximizeURL> JSP tag:

Listing 2-7 Using <portlet:createPortletUnmaximizeURL>

    <%--  Create a link to unmaximize the portlet --%>
<td width="1%" valign="middle">
<a href="<portlet:createPortletUnmaximizeURL/>">
<img src="<webflow:createResourceURL
resource='<%=imagesPath+"portlet_unmax.
gif"%>'/>" hspace="1" vspace="2" border="0"
alt="Unmaximize"></a></td>

<portlet:createPortletFloatURL>

Tag Library

portlet.tld

Import Statement

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

Classes Implemented

CreateFloatURLTag


 

The <portlet:createPortletFloatURL> tag generates a webflow URL that represents creating a "floating" portlet, which is a portlet that appears in an independent window.

Table  2-10 describes the <portlet:createPortletFloatURL> tag attributes.

.

Table 2-10 <portlet:createPortletFloatURL> Tag Attributes

Tag Attribute

Required

Type

Description

R/C

pageName

no

String

The page from which the float URL is generated.

R

portletName

No

String

The portlet ID. This is usually automatically generated, but can be modified.

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

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

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

extraParams

No

String

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

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

httpsInd

No

String

Informs Webflow to calculate the protocol or use HTTPS or HTTP. Valid values are calculate, http, and https.

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.

If a value is not set for this attribute, the context-param value for HTTPSIND_DEFAULT_VALUE in web.xml is used. If no value is found there, calculate is used.

If an invalid value is used for this attribute, calculate is used.

The following example shows a protocol set in web.xml. This value would be used if no JSP tag attribute is set.

<context-param>
<param-name>HTTPSIND_DEFAULT_VALUE</param-name>
<param-value>HTTPS</param-value>
</context-param>

The possible values of HTTP, HTTPS or CALCULATE can be specified in all uppercase or all lowercase.

R

escape

No

String

Tells Weblfow to escape the URL. URLs must be escaped if they will contain any characters (with some exceptions - see below) that would be encoded using java.net.URLEncoder.encode(). Note however that even when escaping is on the entire URL is not encoded rather the URL will be tokenized using the characters ':', '/', '?', '=', and '&' then the substrings between the tokens are encoded using java.net.URLEncoder.encode(). The tokenizing is necessary so that the URL will still be recognized by the Webflow engine.

Valid values for this attribute are 'NO', 'YES' or 'CALCULATE'.

Escaping is relatively costly and should be avoided if possible but is required if the URL might have any characters other then those ignored by java.net.URLEncoder.encode(), that is any characters other than 'a' through 'z', 'A' through 'Z, '0' through '9', '-', '_', '.', or '*' with the exception of the tokenizing characters mentioned above. If the content of the URL will not be determined until runtime and might contain "illegal" characters you should use either 'YES' or 'CALCULATE'. 'CALCULATE' should be used with care.


escape (con't)

No

String

(Continued from previous page)

For sites that have a small number of URLs that will need escaping using 'CALCULATE' rather then 'YES' will result in a performance improvement. But, since 'CALCULATE' first checks the URL then encodes if needed, sites where most URLs need escaping will have poorer performance using 'CALCULATE' rather then 'YES'.

If omitted the default value for escaping is determined by the value of ESCAPE_URLS in the web app's web.xml file. See "Encoding Webflow URLs" for more information.


encode

No

String

Tells 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 determined by the value of ENCODE_URLS set in the web app's web.xml file. URLs will only need to be encoded if the browser does not accept cookies. See "Encoding Webflow URLs" for more information.

R


 

Example

Listing  2-8 illustrates how to use the <portal:createPortletFloatURL> JSP tag:

Listing 2-8 Using <portlet:createPortletFloatURL>

<%
}
if (PortletRenderHelper.isFloatable(request))
{
url = portletState.getUrl(Portlet.URL_CONTENT);
%>
<util:validURL url="<%=url%>">
<% request.setAttribute( "fullscreenPortletURL", url); %>

<td width="1%" valign="middle">
<a href="javascript:submitForm();"
onClick="openBrWindow('<portlet:createPortletFloatURL httpsInd='http'/>','<%= portletWindowName%>', 'scrollbars=yes,width=780,height=550'); return false;">
<img src="<webflow:createResourceURL resource='<%=imagesPath+"portlet_float.gif"%>'/>" hspace="1" vspace="2" border="0" alt="Float" align="absmiddle"></a></td>
</util:validURL>

<portlet:getException>

Tag Library

portlet.tld

Import Statement

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

Classes Implemented

GetExceptionTag

GetExceptionTagExtraInfo


 

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

Table  2-11 describes the

Table 2-11 <portlet:getException> Tag Attributes  

Tag Attribute

Required

Type

Description

R/C

id

no

String

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

R

type

No

String

java class name, can be used to cast your exception.

R

<portlet:getException> tag attributes.

 


Portal Tag Libraries

The following sections describe the portal tags and their attributes.

<portal:createWebflowURL>

Tag Library

portal.tld

Import Statement

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

Classes Implemented

CreatePortalURLTag

CreateWebflowURLTagExtraInfo


 

The <portal:createWebflowURL> tag 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  2-12 describes the <portal:createWebflowURL> tag attributes.

Table 2-12 <portal:createWebflowURL> Tag Attributes

Tag Attribute

Required

Type

Description

R/C

pageName

no

String

The page for which the Webflow URL is being generated.

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

event

yes

String

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

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

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

extraParams

No

String

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

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

httpsInd

No

String

Informs Webflow to calculate the protocol or use HTTPS or HTTP. Valid values are calculate, http, and https.

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.

If a value is not set for this attribute, the context-param value for HTTPSIND_DEFAULT_VALUE in web.xml is used. If no value is found there, calculate is used.

If an invalid value is used for this attribute, calculate is used.

The following example shows a protocol set in web.xml. This value would be used if no JSP tag attribute is set.

<context-param>
<param-name>HTTPSIND_DEFAULT_VALUE</param-name>
<param-value>HTTPS</param-value>
</context-param>

The possible values of HTTP, HTTPS or CALCULATE can be specified in all uppercase or all lowercase.

R

escape

No

String

Tells Weblfow to escape the URL. URLs must be escaped if they will contain any characters (with some exceptions - see below) that would be encoded using java.net.URLEncoder.encode(). Note however that even when escaping is on the entire URL is not encoded rather the URL will be tokenized using the characters ':', '/', '?', '=', and '&' then the substrings between the tokens are encoded using java.net.URLEncoder.encode(). The tokenizing is necessary so that the URL will still be recognized by the Webflow engine.

Valid values for this attribute are 'NO', 'YES' or 'CALCULATE'.

Escaping is relatively costly and should be avoided if possible but is required if the URL might have any characters other then those ignored by java.net.URLEncoder.encode(), that is any characters other than 'a' through 'z', 'A' through 'Z, '0' through '9', '-', '_', '.', or '*' with the exception of the tokenizing characters mentioned above. If the content of the URL will not be determined until runtime and might contain "illegal" characters you should use either 'YES' or 'CALCULATE'. 'CALCULATE' should be used with care.


escape (con't)

No

String

(Continued from previous page)

For sites that have a small number of URLs that will need escaping using 'CALCULATE' rather then 'YES' will result in a performance improvement. But, since 'CALCULATE' first checks the URL then encodes if needed, sites where most URLs need escaping will have poorer performance using 'CALCULATE' rather then 'YES'.

If omitted the default value for escaping is determined by the value of ESCAPE_URLS in the web app's web.xml file. See "Encoding Webflow URLs" for more information.


encode

No

String

Tells 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 determined by the value of ENCODE_URLS set in the web app's web.xml file. URLs will only need to be encoded if the browser does not accept cookies. See "Encoding Webflow URLs" for more information.

R

<portal:form>

Tag Library

portal.tld

Import Statement

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

Classes Implemented

PortalFormTag

CreateWebflowURLTagExtraInfo


 

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

Table  2-13 describes the <portal:form> tag attributes.

Table 2-13 <portal:form> Tag Attributes  

Tag Attribute

Required

Type

Description

R/C

pageName

no

String

The page for which the form is being generated.

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

event

yes

String

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

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

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

extraParams

No

String

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

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

httpsInd

No

String

Informs Webflow to calculate the protocol or use HTTPS or HTTP. Valid values are calculate, http, and https.

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.

If a value is not set for this attribute, the context-param value for HTTPSIND_DEFAULT_VALUE in web.xml is used. If no value is found there, calculate is used.

If an invalid value is used for this attribute, calculate is used.

The following example shows a protocol set in web.xml. This value would be used if no JSP tag attribute is set.

<context-param>
<param-name>HTTPSIND_DEFAULT_VALUE</param-name>
<param-value>HTTPS</param-value>
</context-param>

The possible values of HTTP, HTTPS or CALCULATE can be specified in all uppercase or all lowercase.

R

escape

No

String

Tells Weblfow to escape the URL. URLs must be escaped if they will contain any characters (with some exceptions - see below) that would be encoded using java.net.URLEncoder.encode(). Note however that even when escaping is on the entire URL is not encoded rather the URL will be tokenized using the characters ':', '/', '?', '=', and '&' then the substrings between the tokens are encoded using java.net.URLEncoder.encode(). The tokenizing is necessary so that the URL will still be recognized by the Webflow engine.

Valid values for this attribute are 'NO', 'YES' or 'CALCULATE'.

Escaping is relatively costly and should be avoided if possible but is required if the URL might have any characters other then those ignored by java.net.URLEncoder.encode(), that is any characters other than 'a' through 'z', 'A' through 'Z, '0' through '9', '-', '_', '.', or '*' with the exception of the tokenizing characters mentioned above. If the content of the URL will not be determined until runtime and might contain "illegal" characters you should use either 'YES' or 'CALCULATE'. 'CALCULATE' should be used with care.


escape (con't)

No

String

(Continued from previous page)

For sites that have a small number of URLs that will need escaping using 'CALCULATE' rather then 'YES' will result in a performance improvement. But, since 'CALCULATE' first checks the URL then encodes if needed, sites where most URLs need escaping will have poorer performance using 'CALCULATE' rather then 'YES'.

If omitted the default value for escaping is determined by the value of ESCAPE_URLS in the web app's web.xml file. See "Encoding Webflow URLs" for more information.


encode

No

String

Tells 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 determined by the value of ENCODE_URLS set in the web app's web.xml file. URLs will only need to be encoded if the browser does not accept cookies. See "Encoding Webflow URLs" for more information.

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

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

htmlAttributes

No

String

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

R

<portal:validatedForm>

Tag Library

portal.tld

Import Statement

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

Classes Implemented

PortalValidateFormTag

WebflowValidateFormTagExtraInfo


 

The <portal:validatedForm> tag is used to dynamically generate HTML forms that can be validated. When a Web site visitor enters invalid information, the visitor's input is preserved and redisplayed with an appropriate error message.

Table  2-14 describes the

Table 2-14 <portal:validatedForm> Tag Attributes  

Tag Attribute

Required

Type

Description

R/C

pageName

No

String

The page from which the validated form is being generated.

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

event

yes

String

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

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

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

extraParams

No

String

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

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

httpsInd

No

String

Informs Webflow to calculate the protocol or use HTTPS or HTTP. Valid values are calculate, http, and https.

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.

If a value is not set for this attribute, the context-param value for HTTPSIND_DEFAULT_VALUE in web.xml is used. If no value is found there, calculate is used.

If an invalid value is used for this attribute, calculate is used.

The following example shows a protocol set in web.xml. This value would be used if no JSP tag attribute is set.

<context-param>
<param-name>HTTPSIND_DEFAULT_VALUE</param-name>
<param-value>HTTPS</param-value>
</context-param>

The possible values of HTTP, HTTPS or CALCULATE can be specified in all uppercase or all lowercase.

R

encode

No

String

Tells 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 determined by the value of ENCODE_URLS set in the web app's web.xml file. URLs will only need to be encoded if the browser does not accept cookies. See "Encoding Webflow URLs" for more information.

R

escape

No

String

Tells Weblfow to escape the URL. URLs must be escaped if they will contain any characters (with some exceptions - see below) that would be encoded using java.net.URLEncoder.encode(). Note however that even when escaping is on the entire URL is not encoded rather the URL will be tokenized using the characters ':', '/', '?', '=', and '&' then the substrings between the tokens are encoded using java.net.URLEncoder.encode(). The tokenizing is necessary so that the URL will still be recognized by the Webflow engine.

Valid values for this attribute are 'NO', 'YES' or 'CALCULATE'.

Escaping is relatively costly and should be avoided if possible but is required if the URL might have any characters other then those ignored by java.net.URLEncoder.encode(), that is any characters other than 'a' through 'z', 'A' through 'Z, '0' through '9', '-', '_', '.', or '*' with the exception of the tokenizing characters mentioned above. If the content of the URL will not be determined until runtime and might contain "illegal" characters you should use either 'YES' or 'CALCULATE'. 'CALCULATE' should be used with care.


escape (con't)

No

String

(Continued from previous page)

For sites that have a small number of URLs that will need escaping using 'CALCULATE' rather then 'YES' will result in a performance improvement. But, since 'CALCULATE' first checks the URL then encodes if needed, sites where most URLs need escaping will have poorer performance using 'CALCULATE' rather then 'YES'.

If omitted the default value for escaping is determined by the value of ESCAPE_URLS in the web app's web.xml file. See "Encoding Webflow URLs" for more information.


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

method

No


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

validStyle

No

String

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

R

invalidStyle

No

String

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

R

unspecifiedStyle

No

String

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

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

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

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

htmlAttributes

No

String

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

R

<portal:validatedForm> Tag Attributes.

<portal:createPortalPageChangeURL>

Tag Library

portal.tld

Import Statement

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

Classes Implemented

CreatePageChangeURLTag


 

The <portal:createPortalPageChangeURL> tag generates a webflow URL for a page change event.

Table 2-15 <portal:createPortalPageChangeURL> Tag Attributes  

Tag Attribute

Required

Type

Description

R/C

pageName

No

String

The page for which the event will generated.

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

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

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

extraParams

No

String

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

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

httpsInd

No

String

Informs Webflow to calculate the protocol or use HTTPS or HTTP. Valid values are calculate, http, and https.

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.

If a value is not set for this attribute, the context-param value for HTTPSIND_DEFAULT_VALUE in web.xml is used. If no value is found there, calculate is used.

If an invalid value is used for this attribute, calculate is used.

The following example shows a protocol set in web.xml. This value would be used if no JSP tag attribute is set.

<context-param>

<param-name>HTTPSIND_DEFAULT_VALUE</param-name>

<param-value>HTTPS</param-value>

</context-param>

The possible values of HTTP, HTTPS or CALCULATE can be specified in all uppercase or all lowercase.

See Enabling HTTPS_URL_PATTERNS" on page 7-27 for more information.

R

encode

No

String

Tells 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 determined by the value of ENCODE_URLS set in the web app's web.xml file. URLs will only need to be encoded if the browser does not accept cookies.See "Encoding Webflow URLs" for more information.

R

escape

No

String

Tells Weblfow to escape the URL. URLs must be escaped if they will contain any characters (with some exceptions - see below) that would be encoded using java.net.URLEncoder.encode(). Note however that even when escaping is on the entire URL is not encoded rather the URL will be tokenized using the characters ':', '/', '?', '=', and '&' then the substrings between the tokens are encoded using java.net.URLEncoder.encode(). The tokenizing is necessary so that the URL will still be recognized by the Webflow engine.

Valid values for this attribute are 'NO', 'YES' or 'CALCULATE'.

Escaping is relatively costly and should be avoided if possible but is required if the URL might have any characters other then those ignored by java.net.URLEncoder.encode(), that is any characters other than 'a' through 'z', 'A' through 'Z, '0' through '9', '-', '_', '.', or '*' with the exception of the tokenizing characters mentioned above. If the content of the URL will not be determined until runtime and might contain "illegal" characters you should use either 'YES' or 'CALCULATE'. 'CALCULATE' should be used with care.


escape (con't)

No

String

(Continued from previous page)

For sites that have a small number of URLs that will need escaping using 'CALCULATE' rather then 'YES' will result in a performance improvement. But, since 'CALCULATE' first checks the URL then encodes if needed, sites where most URLs need escaping will have poorer performance using 'CALCULATE' rather then 'YES'.

If omitted the default value for escaping is determined by the value of ESCAPE_URLS in the web app's web.xml file. See "Encoding Webflow URLs" for more information..


Table  2-15 describes the <portlet:createPortalPageChangeURL> tag attributes.

Example

Listing  2-9 illustrates how to use the <portal:createPortalPageChangeURL> JSP tag:

Listing 2-9 Using <portal:createPortalPageChangeURL>

     if (DISPLAY_TEXT_LINKS)
{
if (portalPageName.equals(selectedPage))
            		{
%>
<td class="tabselected" nowrap align="center">
<b>&nbsp;
<a href="<ptl:createPortalPageChangeURL pageName='<%= portalPageName %>'/>"><span class="tabselected"><%=portalPageName%></span></a></b></td>
<td class="tabselected" WIDTH="2"><b>&nbsp;</b></td>
<%
                          }
else
{
%>
<td class="tabunselected" nowrap align="center">
<b>&nbsp;
<a href="<ptl:createPortalPageChangeURL pageName='<%= portalPageName %>'/>"><span class="tabunselected"><%=portalPageName%></span></a></b></td>
<td class="tabunselected" WIDTH="2"><b>&nbsp;</b></td>
<% }

 


Utility Tag Libraries

The following section describes the utility tags and their attributes.

<util:validURL>

Tag Library

util.tld

Import Statement

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

Classes Implemented

ValidURLTag


 

Processes the body if the supplied url is not null and greater than three characters long. Table  2-16 describes the <util:validURL> tag attributes.

Table 2-16 <util:validURL> Tag Attributes  

Tag Attribute

Required

Type

Description

R/C

URL

yes

String

The supplied URL that is processed if it is valid.

R

<util:invalidURL>

Tag Library

util.tld

Import Statement

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

Classes Implemented

InvalidURLTag


 

The <utility:invalidURL> tag processes the body if the supplied url is null or less than four characters long. Table  2-17 describes the <util:invalidURL> tag attributes.

Table 2-17 <util:invalidURL> Tag Attributes  

Tag Attribute

Required

Type

Description

R/C

URL

yes

String

The supplied URL.

R

Example

The following code sample illustrates how to use the <utility:invalidURL> as well as the <utility:validURL> JSP tag:

Listing 2-10 Using <utility:invalidURL> and <utility:validURL>

<%
// First try for an alternate header if one doesn't exist use
// the regular header
url =  portletState.getUrl(Portlet.URL_ALTERNATE_HEADER);
debug.out("Alternate header: " + url);
%>
<util:invalidURL url="<%=url %>">
<% url = portletState.getUrl(Portlet.URL_HEADER); %>
</util:invalidURL>
<util:validURL url="<%=url %>">
<table cellpadding="4" cellspacing="0" width="100%"
class="portletheader">
<tr>
<td width="100%">
<jsp:include page="<%=url%>"/>
</td>
</tr>
</table>
</util:validURL>
<%

 

Back to Top Previous Next