Use JSTL tags in the portal JSPs

WebSphere Portal supports the use of tags from the JSP Standard Tag Library (JSTL).

JSTL 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, portlets, 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:

The underlying getLocales() method of the HTTPServletRequest is overwritten to return the language preference in the user profile as first priority, if available. The getLocales() method also includes the language priorities set in the browser and the Portal default language set in the Global Settings portlet as a final fallback.

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 to use the JSTL tags to display localized text for an HTML anchor.

<%-- help link --%>
<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 language preference in the portal user profile and logging back in to the portal.


Parent

Customize the portal
Portal style classes
Work with portal navigation


Related tasks


Import a theme
Deploy the theme
Create a new skin
Enable automatic JSP reloading
Add support for new clients
Add support for new markup languages
Change banner text
Use the color palette in themes
Performance guidelines for themes and skins


Change the page help

 


+

Search Tips   |   Advanced Search