On Tue, 17 Sep 2002, Henri Yandell wrote:

> Most people will want \n to work I imagine, and won't care that they
> have to do \\n to replace a \ and a n. If I change it so that all
> String attributes get unescaped for Java entities, and maybe even all
> content as well. I wonder if this will hurt anything...

It probably wouldn't, but unfortunately JSP's fighting you on this point.  

If a user enters "\n" as the attribute for a tag, it comes through to your
tag as "n", for "\" is handled by the JSP container (per section JSP.2.6).
The "\" character needs to be escaped as "\\", meaning that "\n" would
need to be entered as "\\n", and "\n" would need to be entered as "\\\\n".  
(This is reminiscent of situations where a Unix tool, not the Unix shell,
must see the "\" escape.)

Thus, while I'd have preferred this solution personally, it might be
better to choose one of the other approaches.  I don't have any ideas off
the top of my head for a syntax that seems pleasant for this...

-- 
Shawn Bayern
"JSTL in Action"   http://www.jstlbook.com


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

Reply via email to