File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

JSTL parameters are not dereferenced

 
Benjamin Weaver
Ranch Hand
Posts: 161
  • 0
  • Mark post as helpful
  • send pies
  • 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...
 
Charles Lyons
Author
Ranch Hand
Posts: 836
  • 0
  • Mark post as helpful
  • send pies
  • 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 ]
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64190
83
IntelliJ IDE Java jQuery Mac Mac OS X
  • 0
  • Mark post as helpful
  • send pies
  • 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
  • 0
  • Mark post as helpful
  • send pies
  • 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
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Oh, and Bear, your question still stands. Thanks. I am reminded that will have to ferret out those inconsistencies.
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic