Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

simple JSTL question

 
Edward Chen
Ranch Hand
Posts: 798
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If I could output the value using
<cut value="${myClass.name}"/>

1. how to use scriptlet <% %> using System.out.println to outpput ?

2. how to trim that value using JSTL , like
<cut value="${ myClass.name.trim() }"/> , but this way doesn't work.

Thanks.
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64631
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
As per forum instructions, please indicate what versions of JSP and JSTL you are using.
 
Edward Chen
Ranch Hand
Posts: 798
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
JSTL 1.0 and JSP 2.0

Thanks
 
Christophe Verré
Sheriff
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
2. how to trim that value using JSTL

There is a fn:trim(string) function in JSTL, but I don't know if it is in 1.0. Check it.
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64631
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Edward Chen:
JSTL 1.0 and JSP 2.0

Thanks


Not compatible. You should be using JSTL 1.1.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic