i am trying to use JSLT.
i followed some instructions.
- i’ve installed a tomcat on xamppp activated it with the control panel and it’s working fine on port 8080.
- in the WEB-INF\lib directory i’ve added a “jstl-1.2.jar” file and a Messages_en_US.properties
this is my test.jsp:
<fmt:setLocale value="en_US" scope="application"/>
<fmt:setBundle basename="Messages"/>
<fmt:message key="welcome" />
<h1>test</h1>
<p>Counting to three:</p>
<% for (int i=1; i<4; i++) { %>
<p>This number is <%= i %>.</p>
<% } %>
<p>Done counting.</p>
the counting worked so my jsp is valid.
but the welcome just shows ???welcome???.
what am i doing wrong?
am i putting the bundles in the right directory?
i tried putting the messages bundle in classes and in WEB-INF – no help.
i also tried restarting the server – it didn’t help.
how can i use string bundles? how can i use several bundles?
cheers,
A number of things could happen.
When you say
it means that you should have
Messages_en.propertiesorMessages_en-US.properties. Usingyou should assign the loaded messages into a variable inside the current scope. When you need to print a message, then, you should use
to display the message.