Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

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

 
Mike Schwall
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic