Search code examples
javaspringjspspring-mvcjsp-tags

Can not find the tag library descriptor of springframework


I'm trying to follow the example of spring JPetStore but I get an error in the JSP pages in the line that references the lib tag spring:

Can not find the tag library descriptor for "http://www.springframework.org/tags"

<%@ taglib prefix="spring" uri="http://www.springframework.org/tags" %>

What is the URL of this library?

Is there any way to avoid the direct dependence on this URL?

Thanks in advance


Solution

    1. Download the Spring dependency jar
    2. Place it to the lib folder path is /WEB-INF/lib/spring.jar
    3. Then open the web.xml and the sample code is:

      <taglib>
        <taglib-uri>/WEB-INF/spring.tld</taglib-uri>
        <taglib-location>/WEB-INF/spring.tld</taglib-location>
      </taglib>
      
    4. Then the taglib is indicated where the jar file locates in ur system.

      <%@ taglib prefix="spring" uri="/WEB-INF/spring.tld" %>