Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to integrate jstl with tomcat 5.5?

Status
Not open for further replies.

cyan01

Programmer
Mar 13, 2002
143
0
0
US
The following question was posted on jsp forum. But I got no answer there. So I guess I would try it here.
=======================================================

I am new to JSP and am study a book "Beginning jsp 2.0". But I am having trouble in running the examples in this book.

Here is the details:

1) The example that I am running:

Code:
<%@ taglib uri="[URL unfurl="true"]http://java.sun.com/jstl/core_rt"[/URL] prefix="c" %>
<html>
    <body>
        You sent the following request headers:
        <p/>
        <table border="1">
            <tr>
                <th>
                    Header
                </th>
                <th>
                    Value
                </th>
            </tr>
        <c:forEach var="entry" items="${header}">
            <tr>
                <td>
                    ${entry.key}
                </td>
                <td>
                    ${entry.value}
                    
                </td>
            </tr>
        </c:forEach>
        </table>
    </body>
</html>

2) The error message I got:

org.apache.jasper.JasperException: The absolute uri: cannot be resolved in either web.xml or the jar files deployed with this application
org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler.java:50)
org.apache.jasper.compiler.ErrorDispatcher.dispatch(ErrorDispatcher.java:407)
org.apache.jasper.compiler.ErrorDispatcher.jspError(ErrorDispatcher.java:114)
org.apache.jasper.compiler.TagLibraryInfoImpl.generateTLDLocation(TagLibraryInfoImpl.java:316)
org.apache.jasper.compiler.TagLibraryInfoImpl.<init>(TagLibraryInfoImpl.java:147)
org.apache.jasper.compiler.Parser.parseTaglibDirective(Parser.java:418)
org.apache.jasper.compiler.Parser.parseDirective(Parser.java:483)
org.apache.jasper.compiler.Parser.parseElements(Parser.java:1539)
org.apache.jasper.compiler.Parser.parse(Parser.java:126)
org.apache.jasper.compiler.ParserController.doParse(ParserController.java:211)
org.apache.jasper.compiler.ParserController.parse(ParserController.java:100)
org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:146)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:286)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:267)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:255)
org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:556)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:296)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:295)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:245)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)

3) My guess is that I did not set up my jstl correctly. I got my jstl at here:


The file name is jakarta-taglibs-standard-1.1.2.zip.

After unzip it, I noticed that there are two jar files in lib dir: jstl.jar and standard.jar. The path for the example listed above is:

%CATALINA_HOME%\webapps\RequestHeaders\request.jsp
%CATALINA_HOME%\webapps\RequestHeaders\WEB-INF\lib\jstl.jar
%CATALINA_HOME%\webapps\RequestHeaders\WEB-INF\lib\standard.jar

Based on my best understanding, that's all I need to do in order to setup jstl. Have I missed something? Or am I totally wrong?

Thank you very much for reading and help!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top