Use JSTL tags in the portal JSPs
WebSphere Portal supports the use of tags from the JSP Standard Tag Library (JSTL), which originated from the Java Community Process to promote the adoption of common JSP tags that would be available in all compliant JSP containers.
Portal themes, skins, and screens can retrieve translated text by using the fmt tags from the JSP Standard Tag Library (JSTL). This method is preferred over using the <portal:text/> tag from the engine tag library, which is deprecated. The following tags from the JSTL tag library are used to retrieve translated text:
- <fmt:setBundle/> - specifies the resource bundle to use.
- <fmt:message/> - specifies the key to retrieve from the bundle and writes the value to output.
The underlying getLocales() method of the HTTPServletRequest is overwritten to return the language preference in the user profile, if available.
Support for the JSTL tag library is provided by WebSphere Portal. To use the JSTL tags, the following directive must be provided in the JSP.
<%@ taglib uri="http://java.sun.com/jstl/fmt" prefix="fmt" %>The following example shows how the HTML help link in the toolbar can be created using the JSTL tags for the link text.
<%-- help button --%> <td class="wpsToolBar" valign="middle" align="<%=bidiAlignRight%>" nowrap="nowrap"> <a class="wpsToolBarLink" href='<%= wpsDocURL %>/InfoCenter/help/index.html' target="... <fmt:setBundle baseName="nls.engine"> <fmt:message key="link.help"/> </fmt:setBundle> </a> </td>Test this code by changing the language preference in the portal user profile and logging back in to the portal.
Related information
- JSP Standard Tag Library Specification
- JSP Standard Tag Library 1.0 implementation
- JSR 52: Standard Java documentation
- Language support
- Customize the portal
- Create your own theme
- Create a new skin
- Performance guidelines for themes and skins
- Support new clients
- Support new markup languages
- Portal style classes
- Change text information
- Change the portal page help
- Work with portal navigation