Only 48 hours left in the trailboss' kickstarter!

New rewards and stretch goals. CLICK HERE!



  • Post Reply Bookmark Topic Watch Topic
  • New Topic

EL works for tags but not in JSP  RSS feed

 
david allen
Ranch Hand
Posts: 185
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,
I am able to use EL when it is within a tag i.e.
Name: <cut value="${name}" />

but if I try and use

Name: ${name}

the jsp simply prints out 'Name: ${name}'

Could someone please tell me if I need to change my configuration. I am using tomcat 5.0
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65824
134
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is your web.xml properly declared as outlined in the JSP FAQ?

Also be sure that you are using the appropriate version of the JSTL.
 
Tim Holloway
Bartender
Posts: 18531
61
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I didn't think that EL was supposed to be evaluated in open text!

Aside from everything else, having that ability would appear to make the <cut> tag redundant.
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65824
134
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Tim Holloway:
I didn't think that EL was supposed to be evaluated in open text!


You're a bit behind the times, Tim. As of JSP 2.0, EL expressions can appear in template text.

Aside from everything else, having that ability would appear to make the <cut> tag redundant.


Not quite, the <cut> action HTML-encodes the values it emits and should be used for any expression that might contain characters that would boof up the HTML markup (or possibly contain injection attacks).
[ January 04, 2007: Message edited by: Bear Bibeault ]
 
Consider Paul's rocket mass heater.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!