tomcat-taglibs-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Calvin Lau <alienat...@yahoo.com>
Subject RE: String Taglib and NewlineToken
Date Thu, 07 Nov 2002 05:57:59 GMT
Thanks Henri.  I cant seem to get str:replace to work at
all, in the nightly build and the latest release version.

I tried using str:encodeURL in these two versions and that
worked fine but whenever I try str:replace (even a simple
case without newlines) I get the error pasted below.  I
still have the very old versions of string.tld and
string.jar that I had been using, and after switching back
to those old files, str:replace worked again (just not with
newlines).

Has anyone been able to use str:replace?  BTW, all I did
was replace the old string.jar and string.tld with the new,
and restart tomcat. web.xml didnt need changing since I had
already been using the tag library.

The error I get when using str:replace
=======================================
2002-11-06 23:29:28 ApplicationDispatcher[]
Servlet.service() for servlet jsp threw exception
org.apache.jasper.JasperException:
org/apache/commons/lang/StringUtils
	at
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:248)
	at
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:289)
	at
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:240)
	at
javax.servlet.http.HttpServlet.service(HttpServlet.java:853)



--- Henri Yandell <bayard@generationjava.com> wrote:
> 
> Hi Calvin,
> 
> Try doing:
> 
> <str:replace replace="NL" with="<br>" newlineToken="NL">
>   <bean:write name="article" property="articleBody"/>
> </str:replace>
> 
> Let me know if that works, if not then I'll get 4.1
> installed and try it
> out myself.
> 
> Also be suspicious of the <br> in case it needs to be
> &gt;br&lt; in the
> new version. [Not that I'm saying it will be, just
> stating the obvious :)]
> 
> Hen
> 
> On Wed, 6 Nov 2002, Calvin Lau wrote:
> 
> > Can someone give me an example of how I would use
> > string:replace to change all the newlines in a chunk of
> > text to <br> tags?  I had been using the following:
> >
> > <str:replace replace="
> > " with="<br>">
> > <bean:write name="article" property="articleBody"/>
> > </str:replace>
> >
> > However, after moving to a new server and upgrading to
> > Tomcat4.1, and this is no longer working.  I wanted to
> give
> > the newlineToken nightly build a try.
> >
> > Thanks,
> >
> > Calvin
> >
> >
> > On Fri, 25 Oct 2002, Henri Yandell wrote:
> > ===========================================
> > So I've now implemented a new attribute named
> newlineToken
> > which is a special token to replace the forced newline.
> So
> > you can do:
> >
> > <str:replace replace="hNL" with="j:NL:y"
> > newlineToken="NL">ih
> > huw</str:replace>
> >
> > and will match the newline. Also note that the same
> > newlineToken may be used in the with attribute.
> >
> >
> > __________________________________________________
> > Do you Yahoo!?
> > U2 on LAUNCH - Exclusive greatest hits videos
> > http://launch.yahoo.com/u2
> >
> > --
> > To unsubscribe, e-mail:  
> <mailto:taglibs-user-unsubscribe@jakarta.apache.org>
> > For additional commands, e-mail:
> <mailto:taglibs-user-help@jakarta.apache.org>
> >
> >
> 
> 
> --
> To unsubscribe, e-mail:  
> <mailto:taglibs-user-unsubscribe@jakarta.apache.org>
> For additional commands, e-mail:
> <mailto:taglibs-user-help@jakarta.apache.org>
> 


__________________________________________________
Do you Yahoo!?
U2 on LAUNCH - Exclusive greatest hits videos
http://launch.yahoo.com/u2

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


Mime
View raw message