JSTL tip, using fn:replace
June 23, 2005 on 12:51 am | In Java |This piece of code will not work, despite one’s best efforts:
Neither will this:
However, this will work. Beats me.
<% pageContext.setAttribute("newline", "n"); %>
Related Posts:
- How to Develop JSF Applications in NetBeans
- Dream coding a Composition
- Exception handling or result code
- How to switch off a screen laptop under Linux
6 Comments »
RSS feed for comments on this post.
Leave a comment
Powered by blog.mu with Pool theme design by Borja Fernandez.


A possible bug in the implementation? Or in the specification?
Comment by AnonymousDuke — 23 June 2005 #
Nice tip!
Comment by Vlad — 10 May 2006 #
Thanks enormously for the tip! I would have spent a long time trying to find a work around…. or just given up entirely.
Comment by Chadwick — 30 May 2006 #
You’re most welcome.
Eddy
Comment by Eddy — 30 May 2006 #
${fn:replace(str, “\\n”, “”)} works…
Comment by Cedric — 20 September 2006 #
Sorry you have to double the backslah… It doesn’t appear when I leave the comment.
${fn:replace(str, “\ \ n”, )}
Comment by Cedric — 20 September 2006 #