wood burning stoves 2.0*
The moose likes IDEs, Version Control and other tools and the fly likes Unable to see jsp output in eclipse Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » IDEs, Version Control and other tools
Bookmark "Unable to see jsp output in eclipse" Watch "Unable to see jsp output in eclipse" New topic
Author

Unable to see jsp output in eclipse

Priety Sharma
Ranch Hand

Joined: Jun 10, 2008
Posts: 156

I created a web project in eclipse.
I added tomcat 5.0 server through the server tab.

I created a simple jsp. I has just one line in the body which says. Welcome jsp.

Now how do I see the the output of this jsp?

What I tried:

I right clicked on the jsp and clicked on Run on Server.

The tomcat server starts but no output appears. No browser opens.
What do I do? What is the way to get this running?

Some changes:
The no browser opens problem is gone.
It was trying to open firefox and could not find it.
So I changed it to "internal browser".

Now when I run it the browser opens.
The url shown is : http://localhost:8080/mywebpro/WEB-INF/jspone.jsp

Now I get status 404.
It says the requested resource is not available.

What do I do now?


Priety.
Mohamed Sanaulla
Saloon Keeper

Joined: Sep 08, 2007
Posts: 3064
    
  33

What is the name of the JSP? And I suppose it is at the root of the application you are trying to deploy.

The URL mostly would be: http://localhost:8080/mywebpro/<jspname>;

And I dont know why the JSP is in the WEB-INF folder.


Mohamed Sanaulla | My Blog
Priety Sharma
Ranch Hand

Joined: Jun 10, 2008
Posts: 156

Hi Mohamed,

Thanks for the reply.

I dont know what I was thinking, the jsp should be outside of the WEB-INF folder.

The name of the jsp is jspone.jsp

Thanks a lot. I think things should be working now.
Sean Clark
Rancher

Joined: Jul 15, 2009
Posts: 377

Hey,

If you are going for the MVC approach the you probably want your JSPs to be under the WEB-INF folder. It makes sense there as you do not want people accessing your jsps directly without going through a Servlet. For example your servlet may load some data from the database and put it in the request so that your JSP page can then display it.

If you were able to access the JSP directly then you'd just get some nasty looking error message because the data would not be there, not very professional.

Here is a good link here: http://www.coderanch.com/t/492064/JSP/java/Jsp-under-WEB-INF

Sean

I love this place!
Priety Sharma
Ranch Hand

Joined: Jun 10, 2008
Posts: 156

Hi Mohamed,

I put the jsp in the webcontent folder and now its working fine.
Thanks again.

Hi Sean,

Thanks for the link. I would be trying the "jsp's under WEB-INF folder" approach too.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Unable to see jsp output in eclipse
 
Similar Threads
About Eclipse and Tomcat configuration
Running an Eclipse3.1 tomcat application on Eclipse Europa
Where does Eclipse look for the tomcat server
Unable to view images
Tomcat 6, Eclipse and 404 errors oh my!