tomcat eclipse jsp problem

Reply

Join Date: Sep 2009
Posts: 6
Reputation: Capra is an unknown quantity at this point 
Solved Threads: 0
Capra Capra is offline Offline
Newbie Poster

tomcat eclipse jsp problem

 
0
  #1
Sep 2nd, 2009
Hi,
I am trying to setup a tomcat server in eclipse galileo java ee to test a simple JSP page. I have problem, but no solution to it. So, if i want to see http://localhost:8080/Project/WEB-INF/Hello.jsp, it gives me error page

HTTP Status 404 - /Project/WEB-INF/Hello.jsp

I have tried to change server location (default server location was "use workspace metadata") , so if I put option "use Tomcat installation", it gives me Tomcat default page on http://localhost:8080 ,
but for Hello. jsp it gives me same error. Last option "use custom location" isn't even available.
Can someone please help me if you have succedeed to resolve it?
I have tried other related problems, but they were solved in other version of Eclipse where this problem is solved by uncheking box
"Run modules directly from the workspace". I don't see this option here, so I am stuck.

Thanks.
Reply With Quote Quick reply to this message  
Join Date: Dec 2004
Posts: 4,191
Reputation: peter_budo has much to be proud of peter_budo has much to be proud of peter_budo has much to be proud of peter_budo has much to be proud of peter_budo has much to be proud of peter_budo has much to be proud of peter_budo has much to be proud of peter_budo has much to be proud of peter_budo has much to be proud of peter_budo has much to be proud of 
Solved Threads: 485
Moderator
Featured Poster
peter_budo's Avatar
peter_budo peter_budo is offline Offline
Code tags enforcer

Re: tomcat eclipse jsp problem

 
-1
  #2
Sep 3rd, 2009
General folder-file structure of project under Tomcat is
  • TOMCAT_DIRECTORY
    • webapps
      • PROJECT_NAME
        • *.jsp
        • *.img
        • *.css
        • WEB-INF
          • web.xml
          • classes
            • *.java or copiled *.class
          • lib
            • Any libraries required like ConnectorJ(database connector) etc.

Have look at this materials
Learn to see in another's calamity the ills which you should avoid.
Publilius Syrus
(~100 BC)

LJC - London Java Community, Graduate & Undergraduate Software Development Community, JAVAWUG (Java Web User Group), The London Android Group
Reply With Quote Quick reply to this message  
Join Date: Sep 2009
Posts: 6
Reputation: Capra is an unknown quantity at this point 
Solved Threads: 0
Capra Capra is offline Offline
Newbie Poster

Re: tomcat eclipse jsp problem

 
0
  #3
Sep 3rd, 2009
Hello,
thanks for your reply.
I have read your link. I followed carefully instructions by link and by book Professional Apache Tomcat 6
(Vivek Chopra,Sing Li,Jeff Genender) and many other tutorilas on the web. But I still didn't solve it.

Any ideas?
Reply With Quote Quick reply to this message  
Join Date: Dec 2004
Posts: 4,191
Reputation: peter_budo has much to be proud of peter_budo has much to be proud of peter_budo has much to be proud of peter_budo has much to be proud of peter_budo has much to be proud of peter_budo has much to be proud of peter_budo has much to be proud of peter_budo has much to be proud of peter_budo has much to be proud of peter_budo has much to be proud of 
Solved Threads: 485
Moderator
Featured Poster
peter_budo's Avatar
peter_budo peter_budo is offline Offline
Code tags enforcer

Re: tomcat eclipse jsp problem

 
-1
  #4
Sep 4th, 2009
Please package your project in ZIP/RAR and attach to next reply and we will have look at it (you need to be in advanced reply mode to see "Manage Attachments" button so first press "Go Advanced")
Learn to see in another's calamity the ills which you should avoid.
Publilius Syrus
(~100 BC)

LJC - London Java Community, Graduate & Undergraduate Software Development Community, JAVAWUG (Java Web User Group), The London Android Group
Reply With Quote Quick reply to this message  
Join Date: Sep 2009
Posts: 6
Reputation: Capra is an unknown quantity at this point 
Solved Threads: 0
Capra Capra is offline Offline
Newbie Poster

Re: tomcat eclipse jsp problem

 
0
  #5
Sep 4th, 2009
Thanks.
I think this is ok. If I forgot something, please tell me.
Attached Files
File Type: zip de.vogella.wtp.filecounter.zip (5.3 KB, 1 views)
File Type: zip Servers.zip (13.8 KB, 1 views)
Reply With Quote Quick reply to this message  
Join Date: Dec 2004
Posts: 4,191
Reputation: peter_budo has much to be proud of peter_budo has much to be proud of peter_budo has much to be proud of peter_budo has much to be proud of peter_budo has much to be proud of peter_budo has much to be proud of peter_budo has much to be proud of peter_budo has much to be proud of peter_budo has much to be proud of peter_budo has much to be proud of 
Solved Threads: 485
Moderator
Featured Poster
peter_budo's Avatar
peter_budo peter_budo is offline Offline
Code tags enforcer

Re: tomcat eclipse jsp problem

 
-1
  #6
Sep 4th, 2009
None of the attached packages has folder structure of project. We need to see stuff that is in TOMCAT_DIRECTORY/webapps/YOUR_PROJECT.
For example at this point I have following files in my webapps
Click image for larger version

Name:	webapps.png
Views:	2
Size:	53.2 KB
ID:	11469
so if we discussed "hudson" I would package that folder and attach it. In your scenario it is anything what is listed in your "Project" directory (that is the place where you started to write your code from what I see in your post localhost:8080/Project/WEB-INF/Hello.jsp)
Learn to see in another's calamity the ills which you should avoid.
Publilius Syrus
(~100 BC)

LJC - London Java Community, Graduate & Undergraduate Software Development Community, JAVAWUG (Java Web User Group), The London Android Group
Reply With Quote Quick reply to this message  
Join Date: Sep 2009
Posts: 6
Reputation: Capra is an unknown quantity at this point 
Solved Threads: 0
Capra Capra is offline Offline
Newbie Poster

Re: tomcat eclipse jsp problem

 
0
  #7
Sep 4th, 2009
Hi,
sorry for wrong packages .

When I use Eclipse IDE Galileo, in Overview page I see that deploy path is set on default to TOMCAT_DIRECTORY/wtpwebapps directory, as you can see in picture I have attached. Maybe that is also problem because it is created there. With this, I can't see
http://localhost:8080/Project/WEB-INF/Hello.jsp or http://localhost:8080.

I then changed to option use " Use Tomcat configuration", and set it to TOMCAT_DIRECTORY/webapps. Now, the Project folder is in webapps like you told me. I am sending you that Project folder in zip.
With this change, I can see http://localhost:8080 ( there is Tomcat default web page ) , but not http://localhost:8080/Project/WEB-INF/Hello.jsp .

I hope now it is ok.
But if I don't solve this,
can you recommend then what Eclipse IDE version ,
Tomcat version, Java version etc. I should install to avoid this problem, and try to write some code .

Thanks.
Attached Thumbnails
tomcat.jpg  
Attached Files
File Type: zip Project.zip (1.5 KB, 0 views)
Reply With Quote Quick reply to this message  
Join Date: Dec 2004
Posts: 4,191
Reputation: peter_budo has much to be proud of peter_budo has much to be proud of peter_budo has much to be proud of peter_budo has much to be proud of peter_budo has much to be proud of peter_budo has much to be proud of peter_budo has much to be proud of peter_budo has much to be proud of peter_budo has much to be proud of peter_budo has much to be proud of 
Solved Threads: 485
Moderator
Featured Poster
peter_budo's Avatar
peter_budo peter_budo is offline Offline
Code tags enforcer

Re: tomcat eclipse jsp problem

 
-1
  #8
Sep 5th, 2009
If you able to see something on localhost:8080 then you will see Tomcat Manager option on left, which you need to click on. Login pop-up will show and you need to provide username and password for tomcat (if you do not know this, you can found these data in TOMCAT_DIRECTORY/conf/tomcat-users.xml). After this you are provided with list of projects in your webapps directory. This still wouldn't work as you do not have your JSP file in correct location and is it having wrong name for welcome-file.

Simple corrections:
  • move Hello.jsp from WEB-INF folder level up to Project
  • make following change to web.xml inside WEB-INF folder (you can either comment out the lines as I did or just simple delete them)
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" id="WebApp_ID" version="2.5">
  3. <display-name>Project</display-name>
  4. <welcome-file-list>
  5. <!-- <welcome-file>
  6. index.html</welcome-file> -->
  7. <!-- <welcome-file>
  8. index.htm</welcome-file> -->
  9. <welcome-file>Hello.jsp</welcome-file>
  10. <!-- <welcome-file>
  11. default.html</welcome-file> -->
  12. <!-- <welcome-file>
  13. default.htm</welcome-file> -->
  14. <!-- <welcome-file>
  15. default.jsp</welcome-file> -->
  16. </welcome-file-list>
  17. </web-app>
Learn to see in another's calamity the ills which you should avoid.
Publilius Syrus
(~100 BC)

LJC - London Java Community, Graduate & Undergraduate Software Development Community, JAVAWUG (Java Web User Group), The London Android Group
Reply With Quote Quick reply to this message  
Join Date: Sep 2009
Posts: 6
Reputation: Capra is an unknown quantity at this point 
Solved Threads: 0
Capra Capra is offline Offline
Newbie Poster

Re: tomcat eclipse jsp problem

 
0
  #9
Sep 5th, 2009
Hi,
thank you very much.
it has solved my problem
Sorry for incovinience.
Reply With Quote Quick reply to this message  
Join Date: Dec 2004
Posts: 4,191
Reputation: peter_budo has much to be proud of peter_budo has much to be proud of peter_budo has much to be proud of peter_budo has much to be proud of peter_budo has much to be proud of peter_budo has much to be proud of peter_budo has much to be proud of peter_budo has much to be proud of peter_budo has much to be proud of peter_budo has much to be proud of 
Solved Threads: 485
Moderator
Featured Poster
peter_budo's Avatar
peter_budo peter_budo is offline Offline
Code tags enforcer

Re: tomcat eclipse jsp problem

 
-1
  #10
Sep 5th, 2009
No problem. Beside already linked Tomcat official website Head First - Servlets and JSP and Tomcat Definitive Guide are good resources to have look at

PS: Can you please mark thread as solved? Just click on "Mark as Solved" bellow last reply. (Small measurement so some "bright" person wouldn't jump on it and try to answer after 1-2 years). Thanx
Learn to see in another's calamity the ills which you should avoid.
Publilius Syrus
(~100 BC)

LJC - London Java Community, Graduate & Undergraduate Software Development Community, JAVAWUG (Java Web User Group), The London Android Group
Reply With Quote Quick reply to this message  
Reply


Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC