Java – Spring adding Tags build error

eclipsejavajspspring

I have got the following errors and i am unable to find an answer. Can someone help me here.

Description Resource Path Location Type
Can not find the tag library descriptor for "http://www.springframework.org/tags" contact.jsp /Spring3HibernateMaven/src/main/webapp/WEB-INF/jsp line 1 JSP Problem

Description Resource Path Location Type
Can not find the tag library descriptor for "http://www.springframework.org/tags/form" contact.jsp /Spring3HibernateMaven/src/main/webapp/WEB-INF/jsp line 2 JSP Problem

My JSP code is as follows;

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

In my Web.xml the code is as follows;

 <jsp-config>
    <taglib>
        <taglib-uri>http://www.springframework.org/tags/form</taglib-uri>
        <taglib-location>spring-form.tld</taglib-location>
    </taglib>
</jsp-config>

How do i solve this error ?

Best Answer

You shouldn't need to configure the taglib in web.xml. Just make sure the org.springframework.web.servlet-xxx.jar is on your classpath (web-inf/lib). It contains the TLD files.