Search code examples
javaspringjakarta-eejsp-tags

taglib configuration in web.xml


  <taglib>
  <taglib-uri>  http://www.java2s.com/custom  </taglib-uri>
  <taglib-location>   /WEB-INF/tags/NewFile.tld  </taglib-location>
  </taglib>

it is showing the error

cvc-complex-type.2.4.a: Invalid content was found starting with element 'taglib'. One of '{"http://java.sun.com/ xml/ns/javaee":module-name, "http://java.sun.com/xml/ns/javaee":description,

any body please sugest me a way to solve this


Solution

  • web.xml is validated against an XML schema. This schema specifies that taglib can occur only when enclosed by a jsp-config tag.

    Hence surround your taglib tag by a jsp-config tag

    Please Refer: http://docs.oracle.com/cd/E11035_01/wls100/webapp/web_xml.html#wp1071166

    for further details.

    Also taglib is no longer required to be declared in web.xml , please read http://wiki.metawerx.net/wiki/RemovingTaglibFromWeb.xml