RE: html:options where values have embedded quotes

2004-03-26 Thread Colm Garvey
It might not be sexy, but a fast solution would be to use something
else instead of quotes e.g. ^ or | and then use a
small Javascript replace function to write out the text correctly?

Colm

-Original Message-
From: Doug [mailto:[EMAIL PROTECTED]
Sent: 24 March 2004 23:25
To: Struts Users Mailing List
Subject: Re: html:options where values have embedded quotes


Anyone?

Doug wrote:

 We have some customer-supplied selection options that have double quotes 
 in their values, and Struts 1.1 isn't seeming to handle this correctly.
 
 Best I can tell from the HTML spec, these should be placed on the page 
 as quot; , which will submit them as %22 , which *should* be seen on 
 the server side as double quotes again, right?  And Struts should be 
 able to match that to an existing entry so it can properly set the 
 selected value.
 
 Instead, it seems the options tag isn't escaping the quotes at all 
 (changing them to quot;) and that if we manually do it ourselves, the 
 selected item still isn't being set when the page is reloaded.  IIRC, 
 the tag is just leaving the quotes inside the attribute value, which 
 outputs invalid HTML.
 
 Am I missing something?  Is there a better way to do this?  Thanks.
 
 Doug

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: html:options where values have embedded quotes

2004-03-25 Thread Joe Germuska
We have some customer-supplied selection options that have double 
quotes in their values, and Struts 1.1 isn't seeming to handle this 
correctly.

Best I can tell from the HTML spec, these should be placed on the 
page as quot; , which will submit them as %22 , which *should* be 
seen on the server side as double quotes again, right?  And Struts 
should be able to match that to an existing entry so it can 
properly set the selected value.

Instead, it seems the options tag isn't escaping the quotes at 
all (changing them to quot;) and that if we manually do it 
ourselves, the selected item still isn't being set when the page 
is reloaded.  IIRC, the tag is just leaving the quotes inside the 
attribute value, which outputs invalid HTML.

Am I missing something?  Is there a better way to do this?  Thanks.
Sounds like a bug to me.  You can see from the code
http://cvs.apache.org/viewcvs.cgi/jakarta-struts/src/share/org/apache/struts/taglib/html/OptionsTag.java?view=markup
that no manipulation is being done to content being rendered between 
attribute quote-delimiters.

Please file a bug at http://issues.apache.org/bugzilla/

Joe

PS it appears that other tags have the same problem; at least, I 
initially looked at OptionTag instead of OptionsTag, and it 
definitely needs the same fix:
http://cvs.apache.org/viewcvs.cgi/jakarta-struts/src/share/org/apache/struts/taglib/html/OptionTag.java?view=markup

--
Joe Germuska
[EMAIL PROTECTED]  
http://blog.germuska.com
  Imagine if every Thursday your shoes exploded if you tied them 
the usual way.  This happens to us all the time with computers, and 
nobody thinks of complaining.
-- Jef Raskin

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: html:options where values have embedded quotes

2004-03-24 Thread Doug
Anyone?

Doug wrote:

We have some customer-supplied selection options that have double quotes 
in their values, and Struts 1.1 isn't seeming to handle this correctly.

Best I can tell from the HTML spec, these should be placed on the page 
as quot; , which will submit them as %22 , which *should* be seen on 
the server side as double quotes again, right?  And Struts should be 
able to match that to an existing entry so it can properly set the 
selected value.

Instead, it seems the options tag isn't escaping the quotes at all 
(changing them to quot;) and that if we manually do it ourselves, the 
selected item still isn't being set when the page is reloaded.  IIRC, 
the tag is just leaving the quotes inside the attribute value, which 
outputs invalid HTML.

Am I missing something?  Is there a better way to do this?  Thanks.

Doug
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]