my dog learned polymorphism*
The moose likes Servlets and the fly likes HTTP Status 404 ERROR Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCM Java EE 6 Enterprise Architect Exam Guide this week in the OCMJEA forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "HTTP Status 404 ERROR" Watch "HTTP Status 404 ERROR" New topic
Author

HTTP Status 404 ERROR

jay kamaru
Greenhorn

Joined: Oct 20, 2009
Posts: 4
this is my servlet:

this is my html:

this is my web.xml:

i have done all this, but the thing it is showing the http status error when i am trying to run servlet.like it is showing
type Status report

message /servlets/coreservlets.showparameters

description The requested resource (/servlets/coreservlets.showparameters) is not available.

i dont know why it isshowing servlets/coreservlets.showparameters

can you please tell where i should make some changes.

thank you
Steve Luke
Bartender

Joined: Jan 28, 2003
Posts: 4181
    
  21

Hi Jay,

Welcome to JavaRanch!

This forum in particular is about IDEs and the like, we have another forum dedicated to Servlets so I will move this thread over there where it may get a better response. In the future CarefullyChooseOneForum from our big list that best suites your question.

Also, I went and edited your original post to add [code][/code] tags to it. The code tags make it a lot easier to read. You can type them in (just as they appear here) manually or you can use the Code button on top of the message editor to add them for you.

Best of luck!


Steve
Ankit Garg
Sheriff

Joined: Aug 03, 2008
Posts: 9293
    
  17

I'm not quite sure why it says that /servlets/coreservlets.showparameters is not available, but is your application deployed on the root context path?? If not, then you might want to use ${pageContext.request.contextPath} before /servlet/Parameters in the action of the form (you'll have to make it a JSP instead of HTML in that case). Also in your servlet you are using "first name" and "last name" to get the request parameter but there's no space between the words in your html page...


SCJP 6 | SCWCD 5 | Javaranch SCJP FAQ | SCWCD Links
Steve Luke
Bartender

Joined: Jan 28, 2003
Posts: 4181
    
  21

Not having worked in this space for a while, I am a bit rusty, but my first guess is a deployment problem. If you make changes to the web.xml you need to restart the application in order to see those changes. As Ankit said, it may also come from looking in improper context (i.e. it tries to look up something in the ROOT context when your classes are in a different one)
Rizwan Patel
Ranch Hand

Joined: Jan 03, 2008
Posts: 59
Hi Jay,

Looking at your web.xml the request /servlet/Parameters should satisfy the requirement and display the page.
But, one problem is how come the request /servlets/coreservlets.showparameters get generated?? I dint understand by looking at the servlet as well as your html.
Will you please clarify from where these request generated and where in web.xml it is mentioned?

Regards,
Rizwan

scjp 1.5, OCPJWSD 5
jay kamaru
Greenhorn

Joined: Oct 20, 2009
Posts: 4
HI thank you for your reply

Actually i itself cant understand from where servlets/coreservlets.showparameters has come while excuteing.i am trying to find out where it exists so that i can edit it...

if you help me to edit it then my problem is solved.
jay kamaru
Greenhorn

Joined: Oct 20, 2009
Posts: 4
HI

Now am getting http400 error when am trying to open my servlet

The webpage cannot be found
HTTP 400
Most likely causes:
There might be a typing error in the address.
If you clicked on a link, it may be out of date.

What you can try:
Retype the address.


Go back to the previous page.

Go to and look for the information you want.

More information

this what i get when am trying to open my /servlet/Parameters

please suggest me.
Ankit Garg
Sheriff

Joined: Aug 03, 2008
Posts: 9293
    
  17

this what i get when am trying to open my /servlet/Parameters


Again this might be due to the context path of the application. If you application is deployed on the context path /myPath, then in your browser try this path /myPath/servlet/Parameters ...
jay kamaru
Greenhorn

Joined: Oct 20, 2009
Posts: 4
Thank you for the reply .

the were helpful.

now am able to excute.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: HTTP Status 404 ERROR