p2p.wrox.com Forums

p2p.wrox.com Forums (http://p2p.wrox.com/index.php)
-   JSP Basics (http://p2p.wrox.com/forumdisplay.php?f=92)
-   -   JSTL problem (http://p2p.wrox.com/showthread.php?t=59013)

winsonkkp June 13th, 2007 01:45 AM

JSTL problem
 
Can somebody tell me what is the problem on this? Please......
Or if anyone have bought the Beginning JavaServer Pages book, please refer to page 41

The code in index.jsp file is like this:

<html>
<head>
<title>Select Your Portal</title>
</head>

<body>
<h1>Select your preferred portal:</h1>
<form action="showportal.jsp" method="get">
<select name="portchoice">
<option>news</option>
<option>weather</option>
<option>entertainment</option>
</select>
<input type="submit" value="Select"/></form>
</body>
</html>

The codes in showportal.jsp is like this:

<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<html>
<c:choose>
    <c:when test="${param.portchoice == 'news'}">
        <head><title>News Portal</title></head>
        <body>
        <h1>Headline News Just For You!</h1></body>
    </c:when>
    <c:when test="${param.portchoice == 'weather'}">
        <head><title>Weather Portal</title></head>
        <body>
        <h1>Accurate Weather Around the Clock!</h1></body>
    </c:when>
    <c:when test="${param.portchoice == 'entertainment'}">
        <head><title>Entertainment Portal</title></head>
        <body>
        <h1>The Most Popular Reality TV Shows!</h1></body>
    </c:when>
    <c:otherwise>
        <head><title>System Portal</title></head>
        <body>
        <h1>Application logic problem detected!</h1></body>
    </c:otherwise>
</html>

The error comes out are like this:

type Exception report

message

description The server encountered an internal error () that prevented it from fulfilling this request.

exception

org.apache.jasper.JasperException: The absolute uri: http://java.sun.com/jsp/jstl/core cannot be resolved in either web.xml or the jar files deployed with this application
    org.apache.jasper.compiler.DefaultErrorHandler.jsp Error(DefaultErrorHandler.java:51)
    org.apache.jasper.compiler.ErrorDispatcher.dispatc h(ErrorDispatcher.java:409)
    org.apache.jasper.compiler.ErrorDispatcher.jspErro r(ErrorDispatcher.java:116)
    org.apache.jasper.compiler.TagLibraryInfoImpl.gene rateTLDLocation(TagLibraryInfoImpl.java:317)
    org.apache.jasper.compiler.TagLibraryInfoImpl.<ini t>(TagLibraryInfoImpl.java:148)
    org.apache.jasper.compiler.Parser.parseTaglibDirec tive(Parser.java:424)
    org.apache.jasper.compiler.Parser.parseDirective(P arser.java:493)
    org.apache.jasper.compiler.Parser.parseElements(Pa rser.java:1557)
    org.apache.jasper.compiler.Parser.parse(Parser.jav a:127)
    org.apache.jasper.compiler.ParserController.doPars e(ParserController.java:212)
    org.apache.jasper.compiler.ParserController.parse( ParserController.java:101)
    org.apache.jasper.compiler.Compiler.generateJava(C ompiler.java:156)
    org.apache.jasper.compiler.Compiler.compile(Compil er.java:296)
    org.apache.jasper.compiler.Compiler.compile(Compil er.java:277)
    org.apache.jasper.compiler.Compiler.compile(Compil er.java:265)
    org.apache.jasper.JspCompilationContext.compile(Js pCompilationContext.java:564)
    org.apache.jasper.servlet.JspServletWrapper.servic e(JspServletWrapper.java:299)
    org.apache.jasper.servlet.JspServlet.serviceJspFil e(JspServlet.java:315)
    org.apache.jasper.servlet.JspServlet.service(JspSe rvlet.java:265)
    javax.servlet.http.HttpServlet.service(HttpServlet .java:803)

note The full stack trace of the root cause is available in the Apache Tomcat/5.5.23 logs.

Hello

iamrakesh22 June 16th, 2007 05:27 AM

Hi,

Try adding the corresponding TLD file[c-rt.tld] to your WEB-INF directory and the jstl jar file to your WEB-INF/lib directory. Please find the step by step information about how to use JSTL at the following links

http://www.exampledepot.com/egs/java...e/usejstl.html
http://jug.org.ua/wiki/display/JavaAlmanac/Using+the+Java+Standard+Tag+Library+(JSTL)+in+a+JS P+Page

Regards,
Rakesh

coureur June 29th, 2007 05:15 PM

Quote:

quote:Originally posted by rakesh_mscit
 Hi,

Try adding the corresponding TLD file[c-rt.tld] to your WEB-INF directory and the jstl jar file to your WEB-INF/lib directory. Please find the step by step information about how to use JSTL at the following links

http://www.exampledepot.com/egs/java...e/usejstl.html
http://jug.org.ua/wiki/display/JavaAlmanac/Using+the+Java+Standard+Tag+Library+(JSTL)+in+a+JS P+Page

Regards,
Rakesh
Correct link: Using the Java Standard Tag Library (JSTL) in a JSP Page - Java Almanac - jug.ORG.ua Wiki

Hope this helps

anubhavharlalka August 9th, 2007 03:20 AM

You have to download the JSTL libraries from the Tomcat website and put it in the lib directory of your Tomcat installation.

Please send me your email id and i'll send it over to you. It was the same problem I faced.



All times are GMT -4. The time now is 11:29 AM.

Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.