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 IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Funky JSTL Install

Status
Not open for further replies.

scripter73

Programmer
Apr 18, 2001
421
US
Hi,

Running Tomcat 4.1 and installed SDK1.4.2.

I just downloaded the JSTL from
and copied the files to my folders:

C:\j2sdk1.4.2..... and c:\Tomcat 4.1\webapps\....\lib.

Here's the code I'm now trying to run (from a book)


<%@ taglib prefix="c" uri=" %>

<html>
<head>
<title>Request Headers</title>
</head>

<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>




Can anyone tell me why I keep getting this error message:


type Exception report

message

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

exception

org.apache.jasper.JasperException: This absolute uri ( cannot be resolved in either web.xml or the jar files deployed with this application




Seems overly complicated?! just to use a library. Is everything downloaded to the right place? Is there a way to test my JSTL?

Thanks in advance.

scripter73


Change Your Thinking, Change Your Life.
 
Yes, the taglib URI has moved from where it used to be !!! Most infuriating. Anyway, below is the working example with correct URI (your posted code also had some errors in it aswell which I've fixed - namely, a ";" after the taglib declaration and a " " betwee the c: and forEach :

You may find this link of use :

(and search for JSTL)

Code:
<%@ taglib uri="[URL unfurl="true"]http://java.sun.com/jsp/jstl/core"[/URL] prefix="c" %>

<html>
<head>
    <title>Request Headers</title>
</head>

<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>
 
Hi sedj,

I really appreciate all of your help. I went to the link you suggested:

I navigated to JSTL section and saw syntax, but I don't think I'm ready for that yet since I can't even get pages to resolve.

It is another tutorial and looks pretty thorough, but I am already going through a tutorial in the Book "Beginning JSP 2.0" by WROX (pub. 03/03).

I'm getting frustrated because this is only Ch 2 and many of these examples are not working. I'm doing nothing but downloading things and skipping through various tutorials and I'm not sure if they are correct, so I'll provide what I have downloaded so far to make sure my installs are correct.

- PATH (system var) = ....c:\j2sdk1.4.2_02\bin ....C:\Tomcat 4.1

- I'm doing development under C:\Tomcat 4.1\webapps\hJSP (the name of my test web app)

- Downloaded the JSTL "jakarta-taglibs\standard\current" to my \j2sdk1.4.2_02 directory. My tutorial suggested I create the folder structure: c:\tomcat 4.1\webapps\hJSP\libs and dump the tags there.

Here's the code I am trying to run, and based on your advice I added your modifications from earlier posts.


<%@ taglib uri=" prefix="c" %>

<html>
<head>
<title>Request Headers</title>
</head>

<body>
You sent the following request headers:
<p />
<table border="1">
<tr>
<th>Header</th>
<th>Value</th>
</tr>
<%
Iterator i = header.entrySet().iterator();
while (i.hasNext()) {
out.println("<td>" +i.next() +"</td>");
}

%>

</table>
</body>
</html>


I'm not sure about all of the syntax, yet since I think the error is still in the first line.
I keep getting the same error. I've made sure I've started Tomcat (but that's a different story):


type Exception report

message

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

exception

org.apache.jasper.JasperException: This absolute uri ( cannot be resolved in either web.xml or the jar files deployed with this application




This is really getting frustrating because you can't even run their simple tutorial examples. How does anyone get any work done with Java? :)

Any advice is greatly appreciated.

Thanks,
scripter73


Change Your Thinking, Change Your Life.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top