Java Reference
In-Depth Information
Joe Asks. . .
Do I Use One or Two Single Quotes in the . properties Files?
For form field labels and free-form text, use a single quote as
follows:
message=That's a great idea!
However, for error and information messages, you need to use
two single quotes:
message=That''s a great idea!
As you can see in Figure 11.2 , on page 224 , all message classes
inherit from SimpleMessage , which uses Java's MessageFormat
class to produce the message. MessageFormat requires a sin-
gle quote to be escaped with another single quote, because
a single quote on its own has a special meaning. Refer to the
MessageFormat Javadocs for more details.
Download email_20/web/WEB-INF/jsp/common/menu.jsp
<c:forEach var="section" items="${actionBean.sections}">
<fmt:message var="text" key="${section.textKey}"/>
<c:choose>
<c:when test="${section eq actionBean.currentSection}">
<span class="currentSection"> ${text} </span>
</c:when>
<c:otherwise>
<s:link beanclass="${section.beanclass}" class="sectionLink">
${text}
</s:link>
</c:otherwise>
</c:choose>
</c:forEach>
We can now place the translated text in the resource bundles:
Download email_20/res/StripesResources.properties
section.MessageList=Messages
section.ContactList=Contact List
section.Compose=Compose
Download email_20/res/StripesResources_fr.properties
section.MessageList=Messages
section.ContactList=Liste des contacts
section.Compose=Composition
 
 
Search WWH ::




Custom Search