I have used <fmt:message> with the bundle attribute previously. Initially you
need to set the bundle using the <fmt:setBundle> tag, this is preferably
done in a jspf file so that it can be reused easily across multiple pages.

Prelude.jspf
<%-- Set the content type for responses --%>
<[EMAIL PROTECTED] contentType="text/html; charset=utf-8" 
pageEncoding="ISO-8859-1"%>
<%-- Common tab libraries --%>
<[EMAIL PROTECTED] uri="http://java.sun.com/jsp/jstl/fmt"; prefix="fmt"%>
<%-- Custom Resource Bundle --%>
<fmt:setBundle basename="com.my.resource.CustomResourceBundle"
var="customBundle"/>

The basename will need to be the class of your resource bundle.

The Prelude.jspf can be added to your web.xml file so that it is available
for each request.

<jsp-config>
    <jsp-property-group>
        <url-pattern>*.jsp</url-pattern>
        <include-prelude>/WEB-INF/jspf/Prelude.jspf</include-prelude>
    </jsp-property-group>
</jsp-config>


Next you can use the bundle within your JSP page using the following syntax:

<out:message key="label.key.name" bundle="${customBundle}"/>
-- 
View this message in context: 
http://www.nabble.com/Specifying-ResourcesBundles-in-%3Cfmt%3Amessage%3E-Tag-tp17252736p17266367.html
Sent from the stripes-users mailing list archive at Nabble.com.


-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft 
Defy all challenges. Microsoft(R) Visual Studio 2008. 
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Stripes-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/stripes-users

Reply via email to