| Author |
HTTP Status 404 -
|
Varnam Aayiram
Ranch Hand
Joined: Dec 23, 2008
Posts: 88
|
|
Hi Folks...
I am getting the following error when I click on the submit buttin of my form:
HTTP Status 404 -
--------------------------------------------------------------------------------
type Status report
message
descriptionThe requested resource () is not available.
I believe this could be something which people encounter regularly. I am not able to figure out why I am getting this. The the form 'action' in jsp is pointing to the correct servlet I want and in the web.xml file, the servlet is declared as well...yet I am gettting this error...The codes are as follows:
sysuserBookingForm.jsp
sysuserBookingFormServlet
web.xml
I really hope someone can advise. Thanks..
|
 |
Devaka Cooray
Saloon Keeper
Joined: Jul 29, 2008
Posts: 2726
|
|
Please IsolateTheProblem instead of posting the whole lengthy code of your Servlet.
For now, what I can guess is, your problem might be with the following statement
request.getRequestDispatcher("bookingConfirmed.jsp").forward(request, response);
Are you sure that bookingConfirmed.jsp exists? Also, you may also want to insert a forward-slash at the beginning:
/bookingConfirmed.jsp
|
Author of ExamLab (Download) - the free mock exam kit for SCJP / OCPJP
Home Page -- Twitter Profile -- JavaRanch FAQ -- How to Ask a Question
|
 |
Varnam Aayiram
Ranch Hand
Joined: Dec 23, 2008
Posts: 88
|
|
Hi Devaka Cooray ...
Thanks for the reply. I have commented out this line:
I was hoping now this line will get printed to the browser
But it's not, I am still getting the same error as before..
|
 |
Jaikiran Pai
Marshal
Joined: Jul 20, 2005
Posts: 8208
|
|
Varnam Aayiram wrote:
I was hoping now this line will get printed to the browser
But it's not, I am still getting the same error as before..
That statement is never processed. You are sending a POST request and the doPost() in the code that you posted, doesn't lead to that statement.
|
[My Blog] [JavaRanch Journal]
|
 |
Varnam Aayiram
Ranch Hand
Joined: Dec 23, 2008
Posts: 88
|
|
Hi Jaikiran Pai ..
Thanks for pointing it out to me. I am still having the problem and I now suspect it's something to do with the folders. All I want to do now is just to make sure that the servlet gets called and writes "This is a test" when the submit button is clicked on the form.
My folder structure is as follows:
I realise that if I were to place sysuserBookingForm.jsp outside the 'sysuser' folder(as in within the Webpages folder but not under any subfolder), and run the project, the form opens up and I click on the submit button, the servlet is invoked and "This is a test" appears in the browser, which is exactly what I want. However this dosen't happen when the sysuserBookingForm.jsp is within the sysuser folder. Do I have to make changes to the form action? I tried the following, this:
was changed to this:
It still gives me the same error. What then is the correct way to call/invoke the servlet from a jsp file that is located in a subfolder of the WebPages folder?
|
 |
Bear Bibeault
Author and ninkuma
Marshal
Joined: Jan 10, 2002
Posts: 56528
|
|
|
You action should be a server-relative URL, beginning with the context path that matches the mapping of the servlet. Anything else will not work.
|
[Smart Questions] [JSP FAQ] [Books by Bear] [Bear's FrontMan] [About Bear]
|
 |
Varnam Aayiram
Ranch Hand
Joined: Dec 23, 2008
Posts: 88
|
|
Hi Bear Bibeault..
I tried this
and it works... Thanks!!!
|
 |
 |
|
|
subject: HTTP Status 404 -
|
|
|