On Sat, 23 Jun 2001, Matteo Di Giovinazzo wrote:

> 
> When I want to insert a single quote, I write in the properties file's
> key " \' " (traditional escaping) to obtain a single quote as output. Indeed
> I obtain that the single quote disappear. Using the '' (double single quote
> escaping) my file don't works with any other java app (a not-Struts app,
> like swin, awt or console...)
> 
> My main question is: this works fine on all other java application, why not
> with Struts? Where is the problem?
> 
> Matteo Di Giovinazzo
> 
> 
> 

Deep down inside org.apache.struts.util.PropertyMessageResources, Struts
is using the load() method from the java.util.Properties class to load the
message resources files.  Therefore, the files should correspond to the
same syntax as any other use of Properties.load() in your applications.

Note that, according to the JDK 1.3 Javadocs, a backslash is the
appropriate escape character for properties files, so a single quote would
be represented as "\'".

Craig McClanahan


Reply via email to