You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Mikkel Bruun <mi...@valtech.dk> on 2001/06/19 15:47:42 UTC

SV: apostrophe in an application resource properties file does di sappear in the JSP file compiled!!!!!!!!!!!

escape it using \'

Mikkel

-----Oprindelig meddelelse-----
Fra: Matteo Di Giovinazzo [mailto:matteodg@infinito.it]
Sendt: 19 June 2001 15:47
Til: struts-user@jakarta.apache.org
Emne: apostrophe in an application resource properties file does
disappear in the JSP file compiled!!!!!!!!!!!


For example in the struts-blank.jar in the ApplicationResource.properties
there is a key with a value that contains an apostrophe (0x27 ASCII Code):

    index.message=[...]Place it in your container's "webapp" folder[...]


In the JSP file that call

    <bean:message key="index.message"/>

the apostrophe disappear!! IS THIS A BUG???


Matteo Di Giovinazzo


Re: single quote in the application properties file don't works on Struts like any other java app?

Posted by "Craig R. McClanahan" <cr...@apache.org>.

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



single quote in the application properties file don't works on Struts like any other java app?

Posted by Matteo Di Giovinazzo <ma...@infinito.it>.
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



Re: apostrophe in an application resource properties file does disappear in the JSP file compiled!!!!!!!!!!!

Posted by Dan Miser <dm...@wi.rr.com>.
Using 2 single quotes does indeed work. And yelling about it doesn't really
help. Can you debug the problem at all to figure out why 2 quotes isn't
working for you?
--
Dan Miser
http://www.distribucon.com

----- Original Message -----
From: "Matteo Di Giovinazzo" <ma...@infinito.it>
To: <st...@jakarta.apache.org>
Sent: Tuesday, June 19, 2001 12:36 PM
Subject: Re: apostrophe in an application resource properties file does
disappear in the JSP file compiled!!!!!!!!!!!


> THIS ESCAPING DOESN'T WORK TOO!!!!!!!!!!!!!!!!!!!!!!!!!!



Re: apostrophe in an application resource properties file does disappear in the JSP file compiled!!!!!!!!!!!

Posted by Matteo Di Giovinazzo <ma...@infinito.it>.
THIS ESCAPING DOESN'T WORK TOO!!!!!!!!!!!!!!!!!!!!!!!!!!

>----- Original Message -----
>From: Peter Alfors
>To: struts-user@jakarta.apache.org
>Sent: Tuesday, June 19, 2001 3:56 PM
>Subject: Re: apostrophe in an application resource properties file does
disappear in the JSP >file compiled!!!!!!!!!!!
>
>
>see mail archive:
>
>http://www.mail-archive.com/struts-user@jakarta.apache.org/msg06172.html
>
>(use two apostrophes)

>Pete





Re: apostrophe in an application resource properties file does disappear in the JSP file compiled!!!!!!!!!!!

Posted by Peter Alfors <pe...@irista.com>.
see mail archive:

http://www.mail-archive.com/struts-user@jakarta.apache.org/msg06172.html

(use two apostrophes)

Pete


Matteo Di Giovinazzo wrote:

> THE ESCAPING \' DOESN'T WORK!!!!
>
> Matteo
>
> >----- Original Message -----
> >From: Mikkel Bruun
> >To: 'struts-user@jakarta.apache.org'
> >Sent: Tuesday, June 19, 2001 3:47 PM
> >Subject: SV: apostrophe in an application resource properties file does
> disappear in the JSP >file compiled!!!!!!!!!!!
> >
> >
> >escape it using \'
> >
> >Mikkel


Re: apostrophe in an application resource properties file does disappear in the JSP file compiled!!!!!!!!!!!

Posted by Matteo Di Giovinazzo <ma...@infinito.it>.
THE ESCAPING \' DOESN'T WORK!!!!

Matteo

>----- Original Message -----
>From: Mikkel Bruun
>To: 'struts-user@jakarta.apache.org'
>Sent: Tuesday, June 19, 2001 3:47 PM
>Subject: SV: apostrophe in an application resource properties file does
disappear in the JSP >file compiled!!!!!!!!!!!
>
>
>escape it using \'
>
>Mikkel