This week's book giveaways are in the Java EE and JavaScript forums.
We're giving away four copies each of The Java EE 7 Tutorial Volume 1 or Volume 2(winners choice) and jQuery UI in Action and have the authors on-line!
See this thread and this one for details.
The moose likes JSP and the fly likes JSTL 1.1 and Tomcat 5 basic problem Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Java » JSP
Bookmark "JSTL 1.1 and Tomcat 5 basic problem" Watch "JSTL 1.1 and Tomcat 5 basic problem" New topic
Author

JSTL 1.1 and Tomcat 5 basic problem

Tony Walters
Ranch Hand

Joined: Feb 13, 2003
Posts: 54
I'm trying to use JSTL 1.1 (actually using 1.1.1) with Tomcat 5. The standard.jar and jstl.jar are in the WEB-INF/lib directory. The page looks like this:

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

<html>
<head></head>
<body>
${3 - 7}<br>
Hello WOrld
<c ut value="${1 + 1}" />
</body>
</html>

My output is like this:

${3 - 7}
Hello WOrld ${1 + 1}

It would appear the JSTL tags are not working. Am I missing something?
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61092
    
  66

The JSTL tags are probably working just fine. What's not working for you is the EL (which is independent of the JSTL in JSP 2.0).

I'm betting that your web.xml still declares yor web app as a Servlet 2.3 web app -- in which case Tomcat will run the app in "compatibility mode".

Declare your web app as a Servlet 2.4 web app in the web.xml usng the XML Schema declaration (as opposed to the old DTD style of declaration).


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Tony Walters
Ranch Hand

Joined: Feb 13, 2003
Posts: 54
Doh! Thanks for that. It now works just fine.
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61092
    
  66

It's not exactly obvious. The only other JSP 2.0 container I've used, Resin, does not work that way so I was a bit confused at first too.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: JSTL 1.1 and Tomcat 5 basic problem