jstl el troubleshooting

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

http://thoughtsgarden.com/p/jstl-1.1.x-installing-configuring/

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"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"
version="2.4">

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:
request.setAttribute("idOfTheBean",beanInstance);

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