• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

JSTL 1.1 and Tomcat 5 basic problem

 
Tony Walters
Ranch Hand
Posts: 54
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 64959
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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).
 
Tony Walters
Ranch Hand
Posts: 54
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Doh! Thanks for that. It now works just fine.
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64959
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic