I am trying jstl code. This is the code from web.xml
<jsp-config>
<taglib>
<taglib-uri >http://displaytag.sf.net</taglib-uri>
<taglib-location>WEB-INF/displaytag.tld</taglib-location>
</taglib>
</jsp-config>
And in my jsp file I have written following line:
<%@ taglib uri="http://displaytag.sf.net" prefix="display" %>
I dont know anything about jstl. And I got this code while searching jstl example on net.As per the note on the net this code is working. But I am getting following exception :
org.apache.jasper.JasperException: File "/WEB-INF/displaytag.tld" not found
The full stack trace :
org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler.java:51)
org.apache.jasper.compiler.ErrorDispatcher.dispatch(ErrorDispatcher.java:409)
org.apache.jasper.compiler.ErrorDispatcher.jspError(ErrorDispatcher.java:116)
org.apache.jasper.compiler.TagLibraryInfoImpl.<init>(TagLibraryInfoImpl.java:160)
org.apache.jasper.compiler.Parser.parseTaglibDirective(Parser.java:424)
org.apache.jasper.compiler.Parser.parseDirective(Parser.java:493)
org.apache.jasper.compiler.Parser.parseElements(Parser.java:1557)
org.apache.jasper.compiler.Parser.parse(Parser.java:127)
org.apache.jasper.compiler.ParserController.doParse(ParserController.java:212)
org.apache.jasper.compiler.ParserController.parse(ParserController.java:101)
org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:156)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:296)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:277)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:265)
org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:564)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:302)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:329)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:265)
javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
I have also included jstl.jar and standard.jar file. What is wrong with this code?
This has nothing to do with JSTL. To learn what exactly JSTL is, check our JSTL wiki page.
Displaytag is not part of JSTL. Displaytag is a completely separate taglib which needs to be downloaded from http://displaytag.sf.net. The very same site also contains installation instructions.