Hi,

I would like to use substring on a c: out like so:

<c:out value="${value.activity.substring(0,4)}"/>

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(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:324)
        at com.caucho.el.MethodExpr.evalObject(MethodExpr.java:105)
        at com.caucho.el.Expr.print(Expr.java:207)
        at _testcode._jstl__jsp._jspService(/TESTCODE/jstl.jsp:103)
        at com.caucho.jsp.JavaPage.service(JavaPage.java:75)
        at com.caucho.jsp.Page.subservice(Page.java:485)
        at com.caucho.server.http.FilterChainPage.doFilter(FilterChainPage.java:182)
        at com.caucho.server.http.Invocation.service(Invocation.java:312)
        at com.caucho.server.http.CacheInvocation.service(CacheInvocation.java:135)
        at com.caucho.server.http.HttpRequest.handleRequest(HttpRequest.java:221)
        at com.caucho.server.http.HttpRequest.handleConnection(HttpRequest.java:163)
        at com.caucho.server.TcpConnection.run(TcpConnection.java:137)
        at java.lang.Thread.run(Thread.java:536)
Caused by: java.lang.StringIndexOutOfBoundsException: String index out
of range: 4
        at java.lang.String.substring(String.java:1477)
        ... 15 more

Any tips would be appreciated,
Stef

Reply via email to