• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

JSTL parameters are not dereferenced

 
Ranch Hand
Posts: 161
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I'm running JSTL 1.1 on Tomcat 5.0.28

At certain odd times (like now) my JSTL code no longer deferences expressions. In the following code:

<c:set var="hello" value="mdkdkdkdkdkdkdkdkd" />
<c ut value="${hello}" />


the output will be ${hello} ,

not mdkdkdkdkdkdkdkdkd as one would expect.

What would cause this?

Ah, the life of a jsp newbie...
 
Author
Posts: 836
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
It looks to me as though you have EL parsing disabled in your application - this is why the container isn't evaluating the ${ ... } expression and resolving it to the variable value (instead it's treating it as a literal string).

There are a couple of ways to ensure EL gets evaluated:

(1) Make sure your web.xml deployment descriptor is declared as being version 2.4 or higher

(2) Use <el-ignored>false</el-ignored> in the deployment descriptor, under a <jsp-property-group> (inside a <jsp-config>) which references the page in question.

(3) Use the page directive in the JSP: <%@ page isELIgnored="false" %>

The order of precedence is (3) overrides (2) overrides (1).

Since you're just starting JSP development, perhaps the easiest thing to do for (to avoid complications of conflicting configuration data) would be to use (3) in each experimental page. However, once it comes to writing applications intended to be deployed for real, you would probably want to use (1), or perhaps (2) to be explicit.

Regards,
Charles.

[ March 13, 2006: Message edited by: Charles Lyons ]
[ March 13, 2006: Message edited by: Charles Lyons ]
 
Sheriff
Posts: 67746
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

At certain odd times (like now)



By this do you mean that sometimes the same page works and sometimes it doesn't?

Or that it works on some pages, but not on others?
 
Benjamin Weaver
Ranch Hand
Posts: 161
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Charles, thanks loads. Your advice (very detailed and impressive) have likely saved me HUGE amounts of time. I would not have figured out these solutions quickly. I will fiddle some more and see if I can get rid of the those explicit directives in the page itself. But for now they work, which is the most important thing.
 
Benjamin Weaver
Ranch Hand
Posts: 161
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Oh, and Bear, your question still stands. Thanks. I am reminded that will have to ferret out those inconsistencies.
 
Bring out your dead! Or a tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic