While you are at it, replace "&" with "&amp;" so that if the user types "&lt;" it won't come out "<". There are some other charactes you can escape if you want to (the quotes and the backslash) but they don't generally cause trouble in TEXTAREAs. The two inportant ones are < and &.

And here's a question for the group... Is there a standard class somewhere that does this recoding? (Something like URLEncoder but for forms data not URLs.) It seems like every time I write a webapp I write another method to make strings safe in HTML textareas. I am haunted by the notion that there must be a standard way to do it that I just can't find. It's a difficult problem to describe to a search engine since all the keywords that describe the problem are keywords used to construct websites.

Lee Haslup

Richard O. Hammer wrote:

Hugh Allen wrote:

1) Typing HTML code into an HTML form text area seems to cause problems. The tags in the templates appear to get confused with the tags in the JSP pages. In effect, I would like the contents of the textarea to be treated as <code>.


Do you know about the way that you can get HTML to render "<" and ">" in a browser? by using "&lt;" and "&gt;"?

Perhaps it would help if process your text at some stage, changing each < and > as above.

Rich Hammer


_______________________________________________ Juglist mailing list [EMAIL PROTECTED] http://trijug.org/mailman/listinfo/juglist_trijug.org






_______________________________________________ Juglist mailing list [EMAIL PROTECTED] http://trijug.org/mailman/listinfo/juglist_trijug.org

Reply via email to