• Post Reply Bookmark Topic Watch Topic
  • New Topic

JSTL discrepancy?

 
Alok Pota
Ranch Hand
Posts: 185
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
<c:set var="tooltip" value="${bean.notes}" />
<c:set var="showtext" value="${fn:substring(bean.notes, 0, 60)}..." />

It turns out that fn:substring(bean.notes, 0, 60) mutates the String bean.notes so tooltip also ends up being truncated.

This is different behaviour from scriptlet code..

<%
String tooltip = bean.getNotes();
String showtext = bean.getNotes().substring(0, 60);
%>

In above tooltip will not be truncated (which is the expected behaviour).

Has anyone else seen this or its just a bug in the app server (Resin)?
 
Stefan Evans
Bartender
Posts: 1822
10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It works for me running Tomcat 5.
This is the page I put together to test it.

 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65522
105
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I also do not observe this behavior either under Tomcat 5.0.25 or under Resin 3.0.14.

What version of Resin are you running?
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!