aspose file tools*
The moose likes Struts and the fly likes How to tell the struts html tag not to substitute any '&' (ampersand) by the HTML Entity & Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "How to tell the struts html tag not to substitute any Watch "How to tell the struts html tag not to substitute any New topic
Author

How to tell the struts html tag not to substitute any '&' (ampersand) by the HTML Entity &

Mike Schwall
Greenhorn

Joined: Apr 26, 2010
Posts: 1
I am a struts newbie and need some help from a developer.
I have some text to output and use for test reasons two different ways in a JSP:
one with struts html tag and one with the good old input tag,
but i used the same value to output:

<html:text property="mytext" value="Buchenwälder"/>
<input name="zuname" type="text" size="30" maxlength="40" value="Buchenwälder">

the browser generates two different lines in the browser output of the web page:

<input type="text" name="mytext" value="Buchenw&auml;lder">
<input name="zuname" type="text" size="30" maxlength="40" value="Buchenwälder">

The difference is that '&' is replaced by the html tag and an additional '&' was inserted.

This is the reason that different values are displayed in the JSP:
"Buchenwälder" for the first line and
"Buchenwälder" in the second line

As i do the encoding by org.apache.commons.lang.StringEscapeUtils.escapeHtml(str) myself,
i don't need any further substitution of characters.

I would appreciate any help!
Thanks !

regards
mike
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How to tell the struts html tag not to substitute any '&' (ampersand) by the HTML Entity &amp;