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

JSTL 1.1 and Tomcat 5 basic problem

 
Ranch Hand
Posts: 54
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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?
 
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Doh! Thanks for that. It now works just fine.
 
Bear Bibeault
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic