You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Kjersti Berg <kj...@gmail.com> on 2005/11/09 14:02:54 UTC

html:textarea - escape html special characters

The html:textarea will escape html special characters to html
entities. Inputing an & will give a string with &amp;. Fair enough. 
But why does inputting a < or > give you &amp;lt; instead of &lt; ?

Kjersti

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: html:textarea - escape html special characters

Posted by Kjersti Berg <kj...@gmail.com>.
On 10/11/05, Laurie Harper <la...@holoweb.net> wrote:
> Kjersti Berg wrote:
> > The html:textarea will escape html special characters to html
> > entities. Inputing an & will give a string with &amp;. Fair enough.
> > But why does inputting a < or > give you &amp;lt; instead of &lt; ?
>
> Probably as a result of how you're using it; maybe you have nested tags
> leading to the HTML escaping happening twice? Can you post a short
> example that demonstrates the problem you're seeing?
>

You were right. After recieving the input I wrote it using the
bean:write tag. That would write &amp; as I expected, but would also
transform &lt; to &amp;lt;. Adding the filter="false" attribute to the
write tag made it function as I intended.

Kjersti

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: html:textarea - escape html special characters

Posted by Laurie Harper <la...@holoweb.net>.
Kjersti Berg wrote:
> The html:textarea will escape html special characters to html
> entities. Inputing an & will give a string with &amp;. Fair enough. 
> But why does inputting a < or > give you &amp;lt; instead of &lt; ?

Probably as a result of how you're using it; maybe you have nested tags 
leading to the HTML escaping happening twice? Can you post a short 
example that demonstrates the problem you're seeing?

L.


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org