wood burning stoves 2.0*
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
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: 60780
    
  65

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: 60780
    
  65

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.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: JSTL 1.1 and Tomcat 5 basic problem
 
Similar Threads
Javascript code exploding the JSLT validation
JSTL issue in Tomcat
JSLT printing c:out value
Tomcat Question
Running JSP in Tomcat 5.5