Java Mailing List Archive

http://www.junlu.com/

Home » Home (12/2007) » Struts 2 »

[S2] Single quote in package.properties

Eric Rank

2007-02-27

Replies:

This should be an easy one.

When putting a single quote in a package.properties resource bundle
entry, by default, the quote get's removed and none of the variables
in the entry get loaded.

1. What's the best way to have an entry with a single quote?
Using &apos; with <s:property value="%{message}" escape="false" />
works, but is this the only way?

2. What are the rules behind how the single quotes work in the
package.properties files? Said differently, what's the intended and
expected behavior of a string with a single quote?

=================================

For example, in the package.properties file:

message.myMessage=I've added a single quote in the first word. and
this variable {0} will not get populated

renders as:

"Ive added a single quote in the first word. and this variable {0}
will not get populated"

when I expect:

I've added a single quote in the first word. and this variable
VariableSentIn will not get populated

=================================

Thanks!

Eric Rank

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@(protected)
For additional commands, e-mail: user-help@(protected)

©2008 junlu.com - Jax Systems, LLC, U.S.A.