2007/7/12, TonyD [EMAIL PROTECTED]:
Do I need a special character before the ' character?
Which one?
I could say the backslash ( \ ) but the apostrophe is not a special
character to be escaped (such as = ! ) so I wonder why you cannot see it...
Antonio
try to double the '
ex.:
mylabel=I don''t know how
If in my .properties file I have text with the ' character
my.properties (file)
mylabel=I don't know how
...
The output doesn't display the ' character
I dont know how
Do I need a special character before the ' character?
Which
I had the same problem, and I put #146; instead of ' in my .properties.
Ragards,
Michaël
TonyD [EMAIL PROTECTED]
12/07/2007 14:29
Veuillez répondre à
Struts Users Mailing List user@struts.apache.org
A
user@struts.apache.org
cc
Objet
How to display the ' character from a .properties file
This should be the good solution, that's what we do ...
[EMAIL PROTECTED] wrote:
try to double the '
ex.:
mylabel=I don''t know how
If in my .properties file I have text with the ' character
my.properties (file)
mylabel=I don't know how
...
The output doesn't display the ' character
Thanks it works!
Pascal Lalonde-4 wrote:
This should be the good solution, that's what we do ...
[EMAIL PROTECTED] wrote:
try to double the '
ex.:
mylabel=I don''t know how
If in my .properties file I have text with the ' character
my.properties (file)
mylabel=I don't know
2007/7/12, TonyD [EMAIL PROTECTED]:
Thanks it works!
Mmm... this means that there's something wrong when you display the text.
I think that, before writing the string, you have to escape it.
How, and where, do you write the string?
Antonio
Actually, I think this is a bug in the handling of MessageResources in
Struts 2. Not only do ' characters in properties files fail to
display, they cause parameter substitution to fail. For example, if
you have a properties file:
foo=Message's for {0}
and you attempt to display it in a jsp
I wrote my string in my .properties file
mylabel=Now it''s working
and then a got it
in my .jsp with
s:text name=mylabel/
Antonio Petrelli-3 wrote:
2007/7/12, TonyD [EMAIL PROTECTED]:
Thanks it works!
Mmm... this means that there's something wrong when you display the text.
On 7/12/07, Niall Pemberton [EMAIL PROTECTED] wrote:
I don't use Struts2 - but my guess is that this is down to a single
quote being an escape character in MessageFormat:
http://java.sun.com/j2se/1.4.2/docs/api/java/text/MessageFormat.html
So its probably not a bug - just need to escape single
9 matches
Mail list logo