• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Can someone help me on EL ??

 
Bm Bm
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I am using tomcat 4.1.31 which supports JSP 1.2
I wrote a JSP :

<%@ page isELIgnored="false" %>
<HTML><BODY>
${param.name}
</BODY></HTML>

I have done following entry in web.xml
<jsp-property-group>
<url-pattern>*.jsp</url-pattern>
<el-ignored>false</el-ignored>
</jsp-property-group>

While running the JSP with above mentioned page directive the container throws an exception saying that
Page directive has invalid attribute: isELIgnored

When i remove the page directive. The output is on the browser is simply the string
${param.name}

As the container gracefully accepts the entry in DD. It is doubtless that the container supports EL.

Can someone tell what am i missing? and what should i do to enable the EL and get the desired output ??

--------------------------------
Regards,
BM.
SCJP 1.4 - 98%
SCWCD Preparing....
 
Will Lee
Ranch Hand
Posts: 58
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I came across similar problem before. I can't explain why, but it seems to related to version of JSTL. The one I came across is: On old tomcat (v4.X), the uri is something like uri="http://java.sun.com/jstl/core", I can't use EL such as ${param.userName}, it only print out same thing, not value (just like EL is ignored), to output the value I have to use <c ut value="${param.userName}" />

However for Tomcat V5.5 (didn't try 5.0), the uri is "http://java.sun.com/jsp/jstl/core", it works on opposite way: It won't take <c ut value="${...}"/>, exception will be thrown and said "the taglib said won't take ${} for c ut value), but it works perfectly when you only use ${param.userName}: it output only the value
 
Karthik Rajendiran
Ranch Hand
Posts: 217
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello Friends,
I think EL is part of JSP2.0 spec. Try download tomcat 5.0.28 or greater ones and try

FOR JSTL
Tomcat 5.0 > onwards you need not web.xml entry to locate tld.
Just placing the standard.jar and jstl.jar in lib directory of ur webapp will solve
 
Bm Bm
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hey Karthik, if EL had been a part of JSP 2.0 then container would not have accepted the DD entry related to EL.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic