struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Kris Schneider <k...@dotech.com>
Subject Re: bean:write
Date Wed, 14 Jan 2004 14:57:42 GMT
The "delims" attribute of <c:forTokens> works just like the "delim" argument to
a StringTokenizer constructor. For example, if you do:

StringTokenizer st = new StringTokenizer("line1<br>line2", "<br>", true);

Then st.countTokens() will return 6, not 3. In other words, the "delims"
attribute should be thought of as a set of delimiter characters, not as a single
delimiter string.

Quoting Mark Lowe <mark.lowe@talk21.com>:

> So you want to replace <br> for \n or similar.
> 
> <c:set var="str" value="${myForm.myProperty}" />
> <c:forTokens var="tok" items="${str}" delims="<br>">
> 	<c:out value="${tok}\n" />
> ...
> 
> This might work.
> 
> 
> On 14 Jan 2004, at 14:30, Otto, Frank wrote:
> 
> > Hello,
> >
> > I want to write a string like "line1<br>line2".
> >
> > If I use <bean:write name="myForm" property="myProperty"/>, I will get 
> > line1&lt;br&gtline2.
> > If I use <bean:write name="myForm" property="myProperty" 
> > filter="false"/>, I will get line1<br>line2.
> >
> > But I want to write:
> >
> > line1
> > line2
> >
> > How can I do this with struts?
> >
> >
> > Regards,
> >
> > Frank

-- 
Kris Schneider <mailto:kris@dotech.com>
D.O.Tech       <http://www.dotech.com/>

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


Mime
View raw message