Code: Select all
//web.xml
<web-app>
<jsp-config>
<taglib>
<taglib-uri>/binomial</taglib-uri>
<taglib-location>/lib/MathLib.jar</taglib-location>
</taglib>
</jsp-config>
</web-app>
Code: Select all
//In index.jsp
<body>
<%@taglib prefix="bi" uri="/binomial"%>
<bi:currentDate/>
</body>
Code: Select all
<taglib version="2.1" 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-jsptaglibrary_2_1.xsd">
<tlib-version>1.0</tlib-version>
<short-name>mytld</short-name>
<uri>/binomial</uri>
<tag>
<name>currentDate</name>
<tagclass>com.tags.CurrentDateTag</tagclass>
<info>Returns the current date with the SHORT date format</info>
<body-content>empty</body-content>
</tag>
</taglib>
The taglib is optional in web.xml with the new web container.