tomcat-taglibs-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Ohring, Peter" <peter.ohr...@purchase.edu>
Subject RE: jstl and splitting carriage returns
Date Thu, 26 May 2005 10:50:12 GMT
I had the same problem last week. For whatever reason (The JSP policy on
whitespace) I couldn't set a variable to "\n" but I could create one
using the following hack:

<c:set var="temp" value="one
two"/>
<c:set var="newline" value="${fn:substring(temp,4,5)}"/>

(Note that on my windows computer temp="one\r\ntwo" so that the 5th
character is the newline character)

Then you should be able to split the string using this new variable,
e.g.

<c:forEach items='${fn:split(feed, newline)}' var="row">
    <c:out value="${row}"/>
</c:forEach>

Peter

-----Original Message-----
From: news [mailto:news@sea.gmane.org] On Behalf Of Digby
Sent: Thursday, May 26, 2005 5:24 AM
To: taglibs-user@jakarta.apache.org
Subject: jstl and splitting carriage returns

Hi again,

Anyone know if it's possible to do an fn:split on carriage returns (\n).

I just get invalid expression error messages with:

         <c:forEach items='${fn:split(feed, "\n")}' var="row">
             <c:out value="${row}"/>
         </c:forEach>

TIA


---------------------------------------------------------------------
To unsubscribe, e-mail: taglibs-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: taglibs-user-help@jakarta.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: taglibs-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: taglibs-user-help@jakarta.apache.org


Mime
View raw message