Quite some environments do not come with JSTL: Eclipse for JEE (Galileo), Tomcat 6, Jetty 6... Follow these steps to add them:
- Add JSTL
Grab the JSTL API (jstl-api.jar) and JSTL implementation (jstl-impl-1.2.jar).
Add the jars to your Container (e.g. Tomcat) lib directory (or your webapp lib).
Alternatively add them using maven dependencies:
12345<
dependency
>
<
groupId
>javax.servlet</
groupId
>
<
artifactId
>jstl</
artifactId
>
<
version
>1.2</
version
>
</
dependency
>
- Make sure the web-app root element in web.xml supports at least servlet 2.4/JSP 2.0 If you use <taglib> elements in web.xml, make sure they are embedded in a <jsp-config> element.1234
xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee
hey guys. i have JSTL trying to run at JavaEE 6. but with not success. can somebody give a hint. i added the 2 jars at classpath.
ReplyDeleteWhich classpath is that exactly?
ReplyDeleteRemark that the post says you should add the jars to the container lib directory or the WEB-INF/lib of your webapp.
Also in JavaEE6 your web.xml normally refers to servlet 3 - and is not even mandatory anymore.
If you are a new to this you could use the glassfish application server. It is normally installed with Java EE 6 and it bundles JSTL so you don't need to configure anything.