File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Tomcat and the fly likes Problem launching a jsp page with eclipse and tomcat    Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » Tomcat
Bookmark "Problem launching a jsp page with eclipse and tomcat    " Watch "Problem launching a jsp page with eclipse and tomcat    " New topic

Problem launching a jsp page with eclipse and tomcat

May Yoong Cheah

Joined: May 04, 2006
Posts: 3

I have just started using eclipse and tomcat for creating dynamic web pages. I tried to launch a jsp page after starting the tomcat server with the URL: http://locahost:8080/HelloWorld/, an error page was displayed as below:

HTTP Status 404 -/

type Status report

message /_

description The requested resource (-) is not available

Apache Tomcat/5.5.17

I didn't get any error at the console and when i just typed http://localhost, a pop up menu saying that the connection was refused when attempting to contact localhost.

I'm not sure what is the problem here. Could it be the permssion to the localhost is not granted by the system as the eclipse IDE is running using linux?

Hope someone can help.

Scott Dunbar
Ranch Hand

Joined: Sep 23, 2004
Posts: 245
Generally when accessing a JSP I would expect a JSP extension on the URL. Something like "http://localhost:8080/helloworld.jsp" or the like. The exception to this is when the JSP is named index.jsp - Tomcat uses that name as a default when only the directory is specified.

To use Eclipse with Tomcat you'll have to start Tomcat with the JPDA. You will want to export the environment variables JPDA_ADDRESS=8000 and JPDA_TRANSPORT=dt_socket (those are the defaults) to enable this. Then, in Eclipse you can debug with the "remote application" method. You'll want to make sure your source and what Tomcat is running are the same thing.

I don't feel that this is a permission problem. Start with getting Tomcat working for a simple JSP page first. Then you should be able to debug more. A warning though - JSP's are very difficult to debug if you are putting Java code in them. If you call a bean or some other code from a JSP that is easy. But if you want to walk through a scriplet in a JSP that can be difficult. The reason is that a JSP is translated into a servlet and then compiled. The translation generates a ton more code than your JSP has. Once your JSP is working take a look in the Tomcat work directory. That contains what Tomcat did to run the JSP.

<a href="" target="_blank" rel="nofollow">Java forums using Java software</a> - Come and help get them started.
I agree. Here's the link:
subject: Problem launching a jsp page with eclipse and tomcat
It's not a secret anymore!