File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Tomcat and the fly likes servlet not loading Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Products » Tomcat
Reply Bookmark "servlet not loading" Watch "servlet not loading" New topic
Author

servlet not loading

Sivaraman Lakshmanan
Ranch Hand

Joined: Aug 02, 2003
Posts: 230
Hai all,
I am developing a web page which uses servlets and JSP. I am using Tomcat server. when I load all my JSP pages are working fine but when i call a servlet i get a error saying that the page u r requesting is unavailable.
How to solve this problem.
I have given all details in web.xml file also.
siva.
William Brogden
Author and all-around good cowpoke
Rancher

Joined: Mar 22, 2000
Posts: 11863
What is the syntax you are using for calling the servlet?
If you are using "../servlet/myservlet" than it sounds like the ever-popular "invoker" servlet problem.
Bill


Java Resources at www.wbrogden.com
Sivaraman Lakshmanan
Ranch Hand

Joined: Aug 02, 2003
Posts: 230
yes I am using the same to invoke the servlet. Then what is the soln for the problem
siva
Mike Curwen
Ranch Hand

Joined: Feb 20, 2001
Posts: 3695

You say : I have given all details in web.xml file also.

What are those details? Does this mean you've supplied a <servlet>, <servlet-mapping> couplet for each servlet you're deploying?
Sivaraman Lakshmanan
Ranch Hand

Joined: Aug 02, 2003
Posts: 230
yes, I have given servlet-name,servlet-class,servlet-mapping etc in the web.xml file.
William Brogden
Author and all-around good cowpoke
Rancher

Joined: Mar 22, 2000
Posts: 11863
The "invoker" servlet is a convenience thing that (In my opinion) is a disaster. You can read about it in the ../conf/web.xml file.
You should not use the invoker, instead, use web.xml to create a servlet mapping from a URL to your servlet name.
Bill
Mike Curwen
Ranch Hand

Joined: Feb 20, 2001
Posts: 3695

Sivaraman,

If you've got the proper mappings, then you shouldn't be putting /servlet into the call to the servlet.

If it's there, take it out.

You don't tell us "how" you call your servlets, so I can only assume you're doing something like:

form action="/servlet/url-mapping"

take out the /servlet part
Sarath Mohan
Ranch Hand

Joined: Mar 17, 2001
Posts: 213
I still have the problem....
Could you please give me the code in web.xml and form action tag for a simple HelloServelt


Sarath Mohan
Mike Curwen
Ranch Hand

Joined: Feb 20, 2001
Posts: 3695

Here's a start ServletInvoker FAQ

Read 'The Middling Tale' for the mapping info.
 
 
subject: servlet not loading
 
Threads others viewed
How to update the browser address with the displayed page
Be the container. HSFJ pg 356
session.getAttribute give null when retreiving session Data in jsps
Urgent -RequestDispatcher.include and forward
Problem retrieving session value in jsp pagess
WebSphere development made easy
without the weight of IBM tools
http://www.myeclipseide.com