Wrox Programmer Forums
|
JSP Basics Beginning-level questions on JSP. More advanced coders should post to Pro JSP.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the JSP Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old June 13th, 2007, 01:45 AM
Registered User
 
Join Date: Jun 2007
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to winsonkkp
Default 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
 
Old June 16th, 2007, 05:27 AM
Friend of Wrox
 
Join Date: Mar 2007
Posts: 373
Thanks: 0
Thanked 1 Time in 1 Post
Default

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
 
Old June 29th, 2007, 05:15 PM
Registered User
 
Join Date: Jun 2007
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default

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
 
Old August 9th, 2007, 03:20 AM
Registered User
 
Join Date: Aug 2007
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to anubhavharlalka Send a message via Yahoo to anubhavharlalka
Default

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.






Similar Threads
Thread Thread Starter Forum Replies Last Post
jstl problem saeed JSP Basics 1 May 22nd, 2007 12:18 PM
jstl problem vivekkumar_23 Pro JSP 1 May 1st, 2007 04:30 AM
JSTL aadz5 JSP Basics 1 August 8th, 2005 08:26 AM
JSTL files problem wechang JSP Basics 4 June 20th, 2005 03:29 AM
JSTL mrkhairy JSP Basics 5 August 8th, 2003 04:57 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.