error trying out tutorial with tomcat

J

Jeff Kish

Hi.

disclaimer.. if this is too complicated, please tell me how to express
the problem more simply.
thanks


I have installed tomcat 5.5 (the latest I believe) on windows xp sp2
home edition.

I'm trying out the tutorial at:


http://java.sun.com/developer/technicalArticles/javaserverpages/JSP20/index.html

When I enter the url:

http://localhost/jsp-examples/jsp2-tutorial/form.jsp?name=xx

It works fine (it displays a form.jsp which is in:

D:\Program Files\Apache Software Foundation\Tomcat
5.5\webapps\jsp-examples\jsp2-tutorial


But when I try to enter the url:

http://localhost/jsp-examples/jsp2-tutorial/math.jsp

I get http status 500 with this exception:

exception

org.apache.jasper.JasperException: The absolute uri:
http://jakarta.apache.org/tomcat/jsp2-example-taglib %>


(The complete error screen is at the bottom.)

I imagine that the error shows it is trying to serve up the math.jsp
file, so it is finding that math.jsp file.

The error component:

<FORM action= cannot be resolved in either web.xml or the jar files
deployed with this application


is telling me it can't make sense of this in the jsp:

<FORM action="\jsp-examples\jsp2-tutorial/math.jsp" method="GET">

Can someone help me understand how to analyze this error?

It is trying to display some fields and add them when the button is
clicked, however I can't figure out the malfunction.

I'm not even getting a box, or a butotn or anything,

I tried changing the jsp to read this, but it still threw an error
saying it could not load the class for the jsp:

<%@ taglib prefix="my"
uri="http://jakarta.apache.org/tomcat/jsp2-example-taglib %>

<HEAD>
<TITLE>Functions</TITLE>
</HEAD>

<BODY>

<H3>Add Numbers</H3>
<P>


</BODY>
</HTML>


So I'm guessing that is the root of the original problem. So, the
class must not be in the correct place I think. mmmm

I assume it is talking about this class:

package jsp2.examples.el;

import java.util.*;

public class Compute{...}

Now I put Compute.java in:

D:\Program Files\Apache Software Foundation\Tomcat
5.5\webapps\jsp-examples\WEB-INF\classes\jsp2\examples\el

and then went to here:
D:\Program Files\Apache Software Foundation\Tomcat
5.5\webapps\jsp-examples\WEB-INF\classes>

and compiled it with:

javac jsp2\examples\el\Compute.java

and the class file is in the directory with the java class.


Can someone tell me what is wrong here, and if I"m
analyzing/approaching the problem correctly? I'm trying to tie all
this taglib stuff together.


is el very commen (expression language) these days?


Thanks
Jeff




HTTP Status 500 -

--------------------------------------------------------------------------------

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://jakarta.apache.org/tomcat/jsp2-example-taglib %>

<HEAD>
<TITLE>Functions</TITLE>
</HEAD>

<BODY>

<H3>Add Numbers</H3>
<P>
<FORM action= cannot be resolved in either web.xml or the jar files
deployed with this application

org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:510)

org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:375)

org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)


root cause

org.apache.jasper.JasperException: The absolute uri:
http://jakarta.apache.org/tomcat/jsp2-example-taglib %>

<HEAD>
<TITLE>Functions</TITLE>
</HEAD>

<BODY>

<H3>Add Numbers</H3>
<P>
<FORM action= 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:423)
org.apache.jasper.compiler.Parser.parseDirective(Parser.java:492)
org.apache.jasper.compiler.Parser.parseElements(Parser.java:1552)
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:155)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:295)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:276)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:264)

org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:563)

org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:303)

org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)


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

Jeff Kish

Dont use '\' here.
Thanks.. I'll try when I get home tonight.. you mean use this instead?
jsp-examples.jsp2-tutorial.math.jsp ? or what exatly?

I basically copied from the tutorial, so I appreciate the clarification, and
maybe a 'why'.

Warm Regards!
Jeff Kish
 
J

Juha Laiho

Jeff Kish said:
http://localhost/jsp-examples/jsp2-tutorial/math.jsp

I get http status 500 with this exception:

exception

org.apache.jasper.JasperException: The absolute uri:
http://jakarta.apache.org/tomcat/jsp2-example-taglib %>

<HEAD>
<TITLE>Functions</TITLE>
</HEAD>

<BODY>

<H3>Add Numbers</H3>
<P>
<FORM action= cannot be resolved in either web.xml or the jar files
deployed with this application

Ok. It tries to handle all of the above as an URL (ok, URI),
whereas apparently only the
http://jakarta.apache.org/tomcat/jsp2-example-taglib
should be an URI.

Looking at the math.jsp source code, they're missing the double quote
from the end of the URI - so instead of

<%@ taglib prefix="my"
uri="http://jakarta.apache.org/tomcat/jsp2-example-taglib %>

there should be

<%@ taglib prefix="my"
uri="http://jakarta.apache.org/tomcat/jsp2-example-taglib" %>

.... hopefully that was all.
 
J

Jeff Kish

Ok. It tries to handle all of the above as an URL (ok, URI),
whereas apparently only the
http://jakarta.apache.org/tomcat/jsp2-example-taglib
should be an URI.

Looking at the math.jsp source code, they're missing the double quote
from the end of the URI - so instead of

<%@ taglib prefix="my"
uri="http://jakarta.apache.org/tomcat/jsp2-example-taglib %>

there should be

<%@ taglib prefix="my"
uri="http://jakarta.apache.org/tomcat/jsp2-example-taglib" %>

... hopefully that was all.
yes, it worked fine after I added the double quote.
Thanks so much.
I guess it was a matter of just looking very carefully at the error
message, and having a bit of experience, right?

Regards! (and thanks so much)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,581
Members
45,057
Latest member
KetoBeezACVGummies

Latest Threads

Top