aspose file tools*
The moose likes Tomcat and the fly likes tomcat servlet not found Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » Tomcat
Bookmark "tomcat servlet not found" Watch "tomcat servlet not found" New topic
Author

tomcat servlet not found

Jo Lee
Ranch Hand

Joined: Jun 26, 2001
Posts: 35
my form action is "myPackage.thisPackage.thatPackage.servlet"
when I run the jsp page in tomcat 4.0.4, I get a error message says:"The requested resource(/MySite/myPackage.thisPackage.thatPackage.servlet) is not available.
My file structures are:
WebApps
--MySite
--WEB-INF
-----classes
-------myPackage
----------thisPackage
-------------thatPackage
-----------------servlet
What is wrong?
Jo
Jo Lee
Ranch Hand

Joined: Jun 26, 2001
Posts: 35
I find out that the uri for the servlet is:
/servlet/myPackage.thisPackage.thatPackage.Servlet
so I change the form action="/servlet/myPackage.thisPackage.thatPackage.Servlet"
I tried also the following:
form action="servlet/myPackage.thisPackage.thatPackage.Servlet"
both give me the same problem: the requested resource is not available.
Please help
Jo
Praveen K Pippiri
Greenhorn

Joined: Jun 17, 2002
Posts: 23
Make the Form action as
/MySite/servlet/myPackage.thisPackage.thatPackage.Servlet
You have to include the web application name also as far as I know.


Praveen<br />Sun Certified Programmer for Java 2 Platform.
Avais Aziz
Greenhorn

Joined: Oct 07, 2001
Posts: 16
Hi Jo!
Change your form action as below.
action='myPackage.thisPackage.thatPackage.Servlet'
Cheers
Avais
Jo Lee
Ranch Hand

Joined: Jun 26, 2001
Posts: 35
Sorry, instead of writing a response, I wrote a new topic by mistake.
I have tried all the suggestions, and it still says that servlet not found.
Is there any trick about tomcat install? May be my tomcat server is not configured right? I am using tomcat-4.0.4
Jo
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 15641
    
  15

No, Tomcat doesn't do any tricky stuff finding servlets - it's strictly per spec. Tomcat has its own forum here on the JavaRanch, BTW, but you'd be having the same problem with WebSphere or WebLogic.
Nowhere did you mention what you set up in the web.xml file, so I'll wager you didn't set it up.
web.xml is where you map the URL to a servlet ID and the servlet ID to its associated class. Older servlet programmers are used to not having to do this explicitly, but that was a major security hole and most modern-day appservers won't find a servlet unless web.xml tells them about it.


Customer surveys are for companies who didn't pay proper attention to begin with.
Anthony Villanueva
Ranch Hand

Joined: Mar 22, 2002
Posts: 1055
Double-check your installation with this
Jo Lee
Ranch Hand

Joined: Jun 26, 2001
Posts: 35
Hi,
Thanks for the information. I did not do the modification on server.xml . Now I have done it and tried the sample servlet from the instruction, it worked beautifully.
Thanks again.
Jo
Mike Curwen
Ranch Hand

Joined: Feb 20, 2001
Posts: 3695

Moved from Servlets -> Apache/Tomcat
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: tomcat servlet not found
 
Similar Threads
Problem with redirect in Servlet Filter
How to register website on Apache
Getting my JSP properties file - please hel
catalina.out log shows all classes being loaded - why?
package issue