• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Devaka Cooray
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Jeanne Boyarsky
  • Tim Cooke
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Tim Moores
  • Mikalai Zaikin
  • Carey Brown
Bartenders:

JSTL discrepancy?

 
Ranch Hand
Posts: 185
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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)?
 
Bartender
Posts: 1845
10
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
It works for me running Tomcat 5.
This is the page I put together to test it.

 
Sheriff
Posts: 67735
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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?
 
today's feeble attempt to support the empire
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic