Corporate Info | News | Solutions | Products | Partners | Services | Events | Download | How To Buy
Commerce Servers Home | WebLogic Portal Doc Home | JSP Tag Libraries | Previous Topic | Next Topic | Contents

# Portal Utilities Tag Reference This is a reference guide for the utility JSP tags used in BEA WebLogic Portal™. ## Contents The Utilities Tag Library <esjsptaglib> <es:condition> <es:counter> <es:foreachinarray> <es:isnull> <es:notnull> <es:preparedstatement> <es:simplereport> <es:transposearray> <es:uricontent> <es:date> <es:usertransaction> ## The Utilities Tag Library <esjsptaglib> The <esjsptaglib> contains generic tags you can use to create JSP pages. ### <es:condition> The <es:condition> tag is used to evaluate a Boolean expression. The tag can either be an empty tag or a tag whose body is executed if the condition evaluates to True.
Attribute | Required? | Default value | Description
--- | --- | --- | ---
test | no |  | The expression to test.
id | When the tag is empty. | id | The variable name to assign.
Example:
    <es:condition id="isYes" test="a.equals(b)"/>
### <es:counter> The <es:counter> is used to create a 'for' loop.
Attribute | Required? | Default value | Description
--- | --- | --- | ---
id | yes |  | A unique name for the variable.
minCount | yes |  | The start position for the loop.
maxCount | yes |  | The end position for the loop.
Example:
    <es:counter id="iterator" minCount="0" maxCount="10">
       <% System.out.println(iterator);%>
    </es:counter>
### <es:foreachinarray> The <es:foreachinarray> tag is used to iterate over an array.
Attribute | Required? | Default value | Description
--- | --- | --- | ---
id | yes |  | The variable for each value in the array.
type | yes |  | The type of each value in the array.
array | yes |  | The array to iterate over.
counterId | no |  | The position in the array.
Example:
    <es:foreachinarray id="item" array="items" type="String" counterId="i">
         <% System.out.println("items[" + i + "]: " + item);%>
    </es:foreachinarray>
### <es:isnull> The <es:isnull> tag is used to check if a value is null. In the case of a String, the <es:isnull> tag is used to check if the String is empty.
Attribute | Required? | Default value | Description
--- | --- | --- | ---
id | yes |  | The variable to evaluate.
Example:
    <es:isnull id="value">
         Error: the value is null.
    </es:isnull>
### <es:notnull> The <es:notnull> tag is used to check if a value is not null. In the case of a String, the <es:notnull> tag is used to check if the String is not empty.
Attribute | Required? | Default value | Description
--- | --- | --- | ---
id | yes |  | The variable to evaluate.
Example:
    <es:notnull id="value">
         The value is not null.
    </es:notnull>
### <es:preparedstatement> The <es:preparedstatement> tag is used to create a JDBC prepared statement.
Attribute | Required? | Default value | Description
--- | --- | --- | ---
id | yes |  | The variable in which the PreparedStatement is returned.
sql | yes |  | The SQL with <es:preparedstatement> tags.
pool | yes |  | The JDBC connection pool from which to get a connection.
Example:
    <es:preparedstatement id="ps" sql="select last_name from user where id=?" pool="jdbcPool">
    <%
       ps.setInt(1, 1234);
       ResultSet rs = ps.execute();
       if ( rs.next() )
       {
         System.out.println(rs.getString(1));
       }
    %>
    </es:preparedstatement>
### <es:simplereport> The <es:simplereport> tag is used to create two-dimensional array out of a simple query.
Attribute | Required? | Default value | Description
--- | --- | --- | ---
id | yes |  | The variable that holds the [ ] array.
resultSet | yes |  | The result set that turns two-dimensional.
Example:
    <es:simplereport id="report" resultSet="resultSet">
    <%
       for (int i=0; ireport[i].length; j++ )
       {
         ...
       }
     }
    %>
    </es:simplereport>
### <es:transposearray> The <es:transposearray> tag is used to transpose a standard [row][column] array to a [column][row] array.
Attribute | Required? | Default value | Description
--- | --- | --- | ---
id | yes |  | The variable that holds the [c][r] array.
type | yes |  | The type of variable in the [r][c] array, such as String.
array | yes |  | The variable that holds the [r][c] array.
Example:
    <es:transposearray id="byColumnRow" array="byRowColumn" type="String">
       ...
    </es:transposearray>
### <es:uricontent> The <es:uricontent> tag is used to pull content from a URL. It is best used for grabbing text-heavy pages.
Attribute | Required? | Default value | Description
--- | --- | --- | ---
id | yes |  | The variable that holds the downloaded content of the URI.
uri | yes |  | The fully qualified URI from which to get the content.
Example:
    <es:uricontent id="uriContent" uri="http://www.beasys.com/index.html">
    <%
       out.print(uriContent);
    %>
    </es:uricontent>
### <es:date> The <es:date> tag is used to get a date and time formatted string based on the user's time zone preference.
Attribute | Required? | Default value | Description
--- | --- | --- | ---
profileGroup | no | The portal's default group | The user's group.
formatStr | no | MMMM dd yyyy hh:mm a zzz | A date and time format string that adheres to the java.text.SimpleDateFormat.
Example: <es:date formatStr="MMMM dd yyyy" doTime="false" /> ### <es:usertransaction> The <es:usertransaction> tag is used to wrap database-intensive code within one effecient transaction. Note: Do not nest these calls. Nested transactions are not supported.
Attribute | Required? | Default value | Description
--- | --- | --- | ---
timeout | no | 600 | The user transaction timeout in seconds.
Example: <es:usertransaction> <% //database inserts %> </es:usertransaction>

Copyright © 2000 BEA Systems, Inc. All rights reserved. Required browser: Netscape 4.0 or higher, or Microsoft Internet Explorer 4.0 or higher.