java - Error: taglib definition is not consistent with specific version during parsing web.xml -
i tried create simple jsp custom tag(empty tag) example in apache 7. got error during parsing web.xml file "taglib definition not consistent specific version during parsing web.xml". files given below.please me
<!--web.xml--> <web-app xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/xmlschema-instance" xsi:schemalocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd" id="webapp_id" version="3.0" > <!-- register tld context , associating unique uri can further used refer tld. optional declaration, you![enter image description here][1] can refer tld directly, explain other options of referring tld in jsp page after example --> <taglib> <taglib-uri>mytags</taglib-uri> <taglib-location>/web-inf/mytags.tld</taglib-location> </taglib> </web-app> <!--mytags.tld--> <!doctype taglib public "-//sun microsystems, inc.//dtd jsp tag library 1.2//en" "http://java.sun.com/dtd/web-jsptaglibrary_1_2.dtd"> <taglib> <tlib-version>1.1</tlib-version> <jsp-version>1.2</jsp-version> <short-name>exampletags</short-name> <info>example custom tags</info> <uri>http://www.mysite.com/jspexamples/exampletags</uri> <tag> <name>getmessage</name> <tag-class>com.santosh.jspex.customtags.hellotaghandler</tag-class> <body-content>empty</body-content> </tag> </taglib> <!--testpage.jsp--> <!-- declare taglib definations making translator aware of custom tags have defined --> <%@taglib uri="mytags" prefix="exampletags"%> <html> <body> <b>response of getmessage tag : </b> <i> <exampletags:getmessage/> </i> <br> </body></html> <!--a tag handler class defined -->
your web.xml
elements defined according pre 2.5 servlet spec. because using 2.5 or post 2.5(3.0) servlet spec, below:
<jsp-config> <taglib> <taglib-uri>mytags</taglib-uri> <taglib-location>/web-inf/mytags.tld</taglib-location> </taglib> <jsp-config>
Comments
Post a Comment