LWS 3.0.1 Released

Problems with the shortcuts generated on Windows XP/NT/2000 have been corrected and the scripts have been improved for all platforms. For Windows you must use the new installer to upgrade (uninstall LWS 3.0 first), but for all other platforms you can upgrade with the JustGetIt module manager.

LWS 3.0 Released

LiteWebServer 3.0 introduces a number of goodies for our popular Java web server: a modular design with the JustGetIt™ module manager for easy upgrades; full support for Servlet 2.3 out-of-the-box and JSP 1.2 as an add-on module; a BSD-style open source license and new support license options.

Why doesn’t Tomcat find my tag library or JSTL?

When I’m running the JSP examples (or some other JSP page that uses a tag library), I receive this error:

org.apache.jasper.JasperException: This absolute uri (http://java.sun.com/jstl/core) cannot be resolved in either web.xml or the jar files deployed with this application

But the tag library JAR files are installed in WEB-INF/lib as the should. What’s wrong?

Answer:
In most cases, you get this error because of one of these issues:

  • There’s a syntax error in your web.xml file. Check the log files and fix any problems listed there.
  • You have mistyped the uri attribute value in the taglib directive. Note that the JSTL URIs changed between the 1.0 and 1.1 version. Make sure you use the URIs that match the version you use!
  • You don’t have all (or the correct) JAR files in the WEB-INF/lib directory, e.g., you’re missing the JSTL standard.jar file or you have the JSTL 1.1 JAR files and try to use the JSTL 1.0 URIs. Note that the examples for the 2nd edition of the book come with JSTL 1.0, and the 3rd edition examples come with JSTL 1.1.
  • You’re trying to use JSTL 1.1 in a JSP 1.2 container, such as Tomcat 4. You need a JSP 2.0 container for JSTL 1.1, e.g., Tomcat 5.
  • You have taglib elements in the web.xml file that conflict with the auto-discovered tag library URIs. Remove all taglib elements from the web.xml file; you don’t need them if you use JSP 1.2 or later.
  • You have TLD files in the WEB-INF directory that conflict with the auto-discovered tag library URIs in the JAR files. Remove all separate TLD files outside of JAR files.
  • Your WEB-INF directory name isn’t in all caps, e.g., it’s something like web-inf, Web-inf or Web-Inf instead; Java is case-sensitive, and the directory name must be in all caps.

For very old versions of Tomcat (e.g., Tomcat 4.0.4) , another reason for this can be that the CATALINA_HOME/temp directory is missing, see http://issues.apache.org/bugzilla/show_bug.cgi?id=11489 for details

Create this directory if it’s missing, restart Tomcat and try again.

Java Enterprise Best Practices released

Java Enterprise Best Practices (O’Reilly) has just been released. This book brings together practical tips based on the experience of O’Reilly writers such as Jason Hunter (servlets), Brett McLaughlin (XML) and George Reese (JDBC), and includes a JSP chapter by me. Buy it now at Amazon.com.