The <example>
element was introduced in Servlet 2.4 / JSP 2.0.
Apart from declaring the taglib root as JSP taglib 2.0 like follows
<taglib
xmlns="http://java.sun.com/xml/ns/j2ee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee/web-jsptaglibrary_2_0.xsd"
version="2.0">
are you also using an appserver which is capable of Servlet 2.4 / JSP 2.0? For example Tomcat 5.x or newer. If not, then you need to upgrade. If so, then this question: is a proper Servlet version (at least 2.4) been declared in web.xml
? If not, then ensure that you're doing so:
<web-app
xmlns="http://java.sun.com/xml/ns/j2ee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"
version="2.4">
or, if you're already using a Servlet 2.5 capable appserver (for example Tomcat 6.x) then just declare Servlet 2.5 to be the best up to date:
<web-app
xmlns="http://java.sun.com/xml/ns/j2ee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_5.xsd"
version="2.5">
If you don't want to upgrade the appserver or to change the Servlet API version declaration in web.xml
, then you need to live with the fact that you cannot use the <example>
element.