aspose file tools*
The moose likes Servlets and the fly likes error - HTTP Status 404 - /EmailList/ Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "error - HTTP Status 404 - /EmailList/ " Watch "error - HTTP Status 404 - /EmailList/ " New topic
Author

error - HTTP Status 404 - /EmailList/

Vaishali Paramane
Ranch Hand

Joined: Mar 05, 2007
Posts: 106
I am trying to deploy a servlet.
It showing HTTPStatus404 error.
type Status report
message /EmailList/
description The requested resource (/EmailList/) is not available.


I created EmailList folder in webapps folder. index.html file in EmailList folder and List.class file in WEB-INF/classes folder

and my web.xml contain

can anyone help me?

Thanks

Vaishali
[ January 16, 2008: Message edited by: Vaishali Paramane ]

SCJP, SCJD
Preparing for SCWCD
Ben Souther
Sheriff

Joined: Dec 11, 2004
Posts: 13410



Two issues:
1.) You've spelled your servlet-name "ListDisplayt" (note the 't' at the end).
2.) Your url-pattern is /simpleServlet. Is that what you are using when you try to access your servlet?


Java API J2EE API Servlet Spec JSP Spec How to ask a question... Simple Servlet Examples jsonf
Ben Souther
Sheriff

Joined: Dec 11, 2004
Posts: 13410

Also, you're starting off on a bad foot by not packaging all of your Java class names. You might be able to get this servlet working without it being packaged but as soon as you start adding beans to your project, things are going to blow up on you.

The default package (no explicit package name) is for trivial command line apps, not web applications.
Vaishali Paramane
Ranch Hand

Joined: Mar 05, 2007
Posts: 106
Thanks ben

I corrected it and add in package simple

In html file I wrote

Now html index file is display but when i submit it showing

HTTP Status 404 - /EmailList/simpleServlet error

--------------------------------------------------------------------------------

type Status report

message /EmailList/simpleServlet

description The requested resource (/EmailList/simpleServlet) is not available.

Thanks

Vaishali



[BSouther: Added UBB CODE tags]
[ January 16, 2008: Message edited by: Ben Souther ]
Ben Souther
Sheriff

Joined: Dec 11, 2004
Posts: 13410

What is the full path to your HTML file (starting with the drive letter of your hard drive)?
Vaishali Paramane
Ranch Hand

Joined: Mar 05, 2007
Posts: 106
My HTML file is stored in
C:\Program Files\Apache Software Foundation\Tomcat 6.0\webapps\EmailList\index.html


and it display fine on tomcat but when I am press submitt button for invoke servlet it showing error.

Thanks

Vaishali
Ben Souther
Sheriff

Joined: Dec 11, 2004
Posts: 13410

In your HTML, your form has no closing tag.

Have you changed the action attribute since you last posted the form?
Did you cut and paste the HTML to the ranch or did you type it?
Vaishali Paramane
Ranch Hand

Joined: Mar 05, 2007
Posts: 106
I copied and paste my html here.
Now I added form closing tab
but still it giving error

Thanks

Vaishali

[ January 16, 2008: Message edited by: Vaishali Paramane ]



[BSouther: Added UBB CODE tags]
[ January 16, 2008: Message edited by: Ben Souther ]
Ben Souther
Sheriff

Joined: Dec 11, 2004
Posts: 13410

After packaging your classes and changing your web.xml file, did you restart your app or Tomcat?
Vaishali Paramane
Ranch Hand

Joined: Mar 05, 2007
Posts: 106
yes I did
I am using tomcat6.0.2.
Thanks
Vaishali

[ January 16, 2008: Message edited by: Vaishali Paramane ]
[ January 16, 2008: Message edited by: Vaishali Paramane ]
Ben Souther
Sheriff

Joined: Dec 11, 2004
Posts: 13410

The error message you're posting doesn't match the url that you've posted.

type Status report
message /EmailList/simpleServlet
description The requested resource (/EmailList/simpleServlet) is not available.

doesn't match
Raghavan Muthu
Ranch Hand

Joined: Apr 20, 2006
Posts: 3355

Yes, i noticed the change in url-pattern but waited to read till the end. There Ben exactly asked for the same.

You need to just look at the url string what you have in your form action! that's where probably it would have gone wrong!


Everything has got its own deadline including one's EGO!
[CodeBarn] [Java Concepts-easily] [Corey's articles] [SCJP-SUN] [Servlet Examples] [Java Beginners FAQ] [Sun-Java Tutorials] [Java Coding Guidelines]
Ben Souther
Sheriff

Joined: Dec 11, 2004
Posts: 13410

The URL in the form's action attribute is not necessarily wrong.
It just doesn't match the URL given in the error message.
I'm wondering if you're either editing the wrong file or if you're not giving us the the most up to date information.

In order to get that error message, the URL in the form's action attribute would have to be "/EmailList/simpleServlet" or "/simpleServlet".

Either that or your HTML page is in webapps/ROOT/EmailList instead of being in webapps/EmailList.

Something on your server isn't matching what you're posting here.
[ January 17, 2008: Message edited by: Ben Souther ]
Vaishali Paramane
Ranch Hand

Joined: Mar 05, 2007
Posts: 106
Thanks Ben

I gave correct information but my web.xml is EmailList directory outside the WEB-INF.
Now I moved web.xml in WEB-INF directory and its working .

second one I was compiled java file in jdk1.6 and my tomcat has set path of java jar1.5.
Now my problem solve.

Thanks for help.

I stucked this point from last week and only for your help I solved.
Really thanks.

Thanks

Vaishali
Ben Souther
Sheriff

Joined: Dec 11, 2004
Posts: 13410

Glad it's working for you.
Thanks for posting back with the solution.
Raghavan Muthu
Ranch Hand

Joined: Apr 20, 2006
Posts: 3355

That's great Vaishali

Thanks for posting back with the solution. It may help others with a similar issue.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: error - HTTP Status 404 - /EmailList/