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

problem with jstl

 
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello all,
i have one problem as follows. I am trying to display request paramater value using corejstl tag <c ut value="${param.paramter-name}"/> that i had set in prevoius jsp page. But rather than displaying the actual value of that parameter it is displaying like {param.parameter-name}. The to file are

1.first.jsp
<form .... >
<input type="text" name="address" value="heaven"/>
</form>

2.second.jsp
<form...>
<c ut value="${param.address}"/>
</form>

Output is
{param.address}

i am using tomcat 4.1.24, is there any problem with this version ? Please help me to solve this problem.
Thanx.
 
Sheriff
Posts: 7023
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The following example seems to work fine for me.

page1.jsp

page2.jspAre you certain that your server supports JSP 2.0 and that expression language support isn't turned off?
[ September 23, 2004: Message edited by: Dirk Schreckmann ]
 
Dirk Schreckmann
Sheriff
Posts: 7023
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Ah, I notice now that you said: i am using tomcat 4.1.24, is there any problem with this version ?

That's a problem. Tomcat 4.1.24 doesn't support JSP 2, which includes not supporting the expression language (EL). At http://jakarta.apache.org/tomcat/ notice the little blue table of the Servlet and JSP versions supported by the different versions of Tomcat.

So, if you want to use EL support, you'll have to use something other than Tomcat 4.x.
[ September 23, 2004: Message edited by: Dirk Schreckmann ]
 
rakesh damkondwar
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Dirk,
i have gone through URL that u sent for this problem. Now i have understood what the problem is, i have to use Tomcat5.x in order to use EL since its a kind of versioning problem. Thankx a lot for helping in this issue.
 
Ranch Hand
Posts: 101
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
> That's a problem. Tomcat 4.1.24 doesn't support JSP 2

That should not be a problem. EL was first introduced in JSTL 1.0.
And if you look at the Jakarta Standard-1.0 Taglib page, you'll see:

NOTE: Standard-1.0 (JSTL 1.0) requires a JSP container that supports the Java Servlet 2.3 and
JavaServer Pages 1.2 specifications. Jakarta Tomcat 4 supports these specifications.
The Standard 1.0 taglib has been tested with Tomcat 4.1.24.
 
Dirk Schreckmann
Sheriff
Posts: 7023
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am not familiar with the details of JSTL 1.0.

Jean, if I've understood your post correctly, it says that JSTL 1.0 should interpret EL constructs passed to it. Is that what you're saying?

I just tried out the above examples on Tomcat 4.1.30 with JSTL 1.0.6, and the EL construct is not interpreted, as the initial poster experienced.

I did just notice in part 3 of Hans Bersten's JSTL 1.0 article series at O'Reilly the following:

A JSP 1.2 container doesn't know anything about EL expressions, so they are evaluated by code in the JSTL tag handlers.

And in part 1:

All JSTL actions recognize EL expressions in their attribute values, and custom actions may be developed to do the same.

So, the question then is what are the original poster and I not aware of? Why aren't our examples having the EL interpreted?
[ September 24, 2004: Message edited by: Dirk Schreckmann ]
 
Dirk Schreckmann
Sheriff
Posts: 7023
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
OK. I finally found my problem. I was using the RT libraries, as specified by the following line.

<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c" %>

Apparently the RT libraries don't interpret EL constructs.

Change that line to

<%@ taglib uri="http://java.sun.com/jstl/core" prefix="c" %>

and the EL construct passed as the value to the JSTL attribute is interpreted.

rakesh, does this solve your original problem?
 
Jean-Francois Briere
Ranch Hand
Posts: 101
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
> Jean, if I've understood your post correctly, it says that JSTL 1.0
> should interpret EL constructs passed to it. Is that what you're saying?

Exactly. Not in any other part of the JSP pages for JSP 1.2 containers.
 
It's weird that we cook bacon and bake cookies. Eat this tiny ad:
We need your help - Coderanch server fundraiser
https://coderanch.com/wiki/782867/Coderanch-server-fundraiser
reply
    Bookmark Topic Watch Topic
  • New Topic