tomcat-taglibs-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Shawn Bayern <>
Subject Re: Is there a way to call java.lang.String.substring on a <c: out ?
Date Fri, 11 Oct 2002 01:01:30 GMT
On Thu, 10 Oct 2002, Stefan wrote:

> Hi,
> I would like to use substring on a c: out like so:
> <c:out value="${value.activity.substring(0,4)}"/>

No, this can't be done in JSTL 1.0.  You'll be able to define functions in
the EL in JSP 2.0, but for now, any attempt to do so should yield a
translation-time error, as the syntax isn't supported.

> It works but at the same time I get this error:
> 500 Servlet Exception 
> java.lang.reflect.InvocationTargetException
> 	at sun.reflect.GeneratedMethodAccessor9.invoke(Unknown Source)
> 	at sun.reflect.DelegatingMethodAccessorImpl.invoke(
> 	at java.lang.reflect.Method.invoke(
> 	at com.caucho.el.MethodExpr.evalObject(

You might want to mail the Caucho folks and ask them about this; their
implementation is different from Jakarta Taglibs's.  Note again that it
*shouldn't* work; if it does, then an implementation isn't JSTL-compliant.

You can use other tag libraries like the String Taglib to perform string
manipulation in your JSP pages.

Shawn Bayern
"JSTL in Action"

To unsubscribe, e-mail:   <>
For additional commands, e-mail: <>

View raw message