jstl el troubleshooting

A comprehensive troubleshooting guide handling some common jstl/el mistakes:


My experience

1. Download the yakarta taglibs from here: http://jakarta.apache.org/site/downloads/downloads_taglibs-standard.cgi and copy the standard.jar and jstl.jar towards the /WEB-INF/lib/ folder of your webapp.

2. make sure to have the right web.xml declaration, at least 2.4

<web-app xmlns="http://java.sun.com/xml/ns/j2ee"
xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"

3. In your jsp pages define the taglibs like this (only the ones you need):

At this point jstl and el should work without the need of adding any tld definitions in the web.xml definition. You can put a javabean on the request in your servlet by this code:

Note that a javabean should always have a no args ctor and public setters and getters for private properties.

A great toturial on the MVC part of jsp/servlets/javabeans is this: http://courses.coreservlets.com/Course-Materials/pdf/msajsp/0B-MVC-Review.pdf

Leave a Reply

Your email address will not be published. Required fields are marked *

Please reload

Please Wait