Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Java > Java and JDK > JSP Basics
Password Reminder
Register
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
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 tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old June 13th, 2007, 01:45 AM
Registered User
 
Join Date: Jun 2007
Location: Sepang, Selangor, Malaysia.
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
Reply With Quote
  #2 (permalink)  
Old June 16th, 2007, 05:27 AM
Friend of Wrox
 
Join Date: Mar 2007
Location: Hyderabad, A.P., India.
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
Reply With Quote
  #3 (permalink)  
Old June 29th, 2007, 05:15 PM
Registered User
 
Join Date: Jun 2007
Location: , , .
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
Reply With Quote
  #4 (permalink)  
Old August 9th, 2007, 03:20 AM
Registered User
 
Join Date: Aug 2007
Location: Kolkata, West Bengal, India.
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.

Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


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



All times are GMT -4. The time now is 03:54 AM.


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