When I try putting the '\\\n' in with the escapeXmL attribute set to false, I get this:
org.apache.jasper.JasperException: /filename.jsp(301,2) Attribute escapeXmL invalid
for
tag out according to TLD
Which makes no sense what-so-ever. I tried just putting the escapeXmL="false"
attribute
in with '\n' being my string, and I get my original error.
I think the problem may be that it's not seeing \n as the return character from my
database.
Any ideas?
Keith
---------- Original Message -----------
From: Pierre Delisle <[EMAIL PROTECTED]>
To: Tag Libraries Users List <[EMAIL PROTECTED]>
Sent: Tue, 13 Apr 2004 18:08:51 -0700
Subject: Re: Replacing returns with <br>
> Not very intuitive, but the following should work:
>
> <c:set var="s5" value="First line\nSecond line"/>
> <c:out value="${fn:replace(s5,'\\\n','<br>')}" escapeXml="false"/>
>
> -- Pierre
>
> Keith wrote:
>
> > I have a column in a database that is used to store a comments section. It's just
> > a
large
> > string (VARCHAR2(4000) in Oracle), and the information is entered into it via a
> > <textarea> form field. If I output that data to another <textarea> I can see that
> > the
> > return characters are preserved in the database.
> >
> > I was trying to output this column's data as normal text in HTML, but need to
preserve
> > the returns somehow. I was thinking I could use the <fn:replace> action to turn
> > them
into
> > <br>'s, but I'm not sure how it sees the return characters in the string. I tried
this:
> >
> > <c:out value="${fn:replace(row.comments, '\n', '<br>')}" />
> >
> > But get this error back:
> >
> > org.apache.jasper.JasperException: /filename.jsp(281,2) "${fn:replace
> > (row.comments, '\n', '<br>')}" contains invalid expression(s):
> > javax.servlet.jsp.el.ELException: Encountered "'\n", expected one of
[<INTEGER_LITERAL>,
> > <FLOATING_POINT_LITERAL>, <STRING_LITERAL>, "true", "false", "null", "(", "-
> > ", "not", "!", "empty", <IDENTIFIER>]
> >
> >
> > Anyone help with how I can go about doing this? Thanks!
> >
> > Keith
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> >
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
------- End of Original Message -------
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]