Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Include JSTL dependency with Maven

I am using maven2, how do I add a dependency to JSTL (The JSP Standard Tag Library) ?

like image 592
flybywire Avatar asked Feb 16 '10 20:02

flybywire


People also ask

Does Tomcat include JSTL?

Tomcat does not provide the Java Server Tag Library (JSTL), which is required to use JSP pages as Spring views. The IdP status page at /idp/status is built with JSP and will not work without this library. You can download it from here, place it into idp.

What is the use of JSTL dependency?

JSTL stands for JSP Standard Tag Library. JSTL is the standard tag library that provides tags to control the JSP page behavior. JSTL tags can be used for iteration and control statements, internationalization, SQL etc.

Does spring use JSTL?

Spring provides a couple of out-of-the-box solutions for JSP and JSTL views. Using JSP or JSTL is done using a normal view resolver defined in the WebApplicationContext . Furthermore, of course you need to write some JSPs that will actually render the view.


1 Answers

The dependencies mentioned above is not enough for me(using Tomcat 5.x as servlet container, which doesn't provide JSTL implementation itself). It just imports the according JSTL interface package into project, and will cause a runtime error in Tomcat.

Here is the dependency part used in my project, hopefully can help others out. The hardest part is the naming of the Apache's JSTL implementation in repository.

  <dependency>         <groupId>javax.servlet</groupId>         <artifactId>jstl</artifactId>         <version>1.1.1</version>         <scope>runtime</scope>     </dependency>     <dependency>         <groupId>taglibs</groupId>         <artifactId>standard</artifactId>         <scope>runtime</scope>         <version>1.1.1</version>     </dependency>     <dependency>         <groupId>taglibs</groupId>         <artifactId>c</artifactId>         <version>1.1.1</version>         <scope>runtime</scope>         <type>tld</type>     </dependency>     <dependency>         <groupId>taglibs</groupId>         <artifactId>fmt</artifactId>         <version>1.1.1</version>         <scope>runtime</scope>         <type>tld</type>     </dependency> 
like image 161
Jerry Tian Avatar answered Sep 21 '22 00:09

Jerry Tian