Author | Message |
---|---|
aligh1979
Posts: 121
|
Posted 14:58 Oct 07, 2011 |
assume that I have created a servlet name AddRubric and a jsp by the same name AddRubric.jsp the first time if somebody wants to add a rubric , the request goes to get method and forwarded to AddRubric.jsp , after someone put the name of the rubric and scale and press Next , it is supposed to be processed by the Post methods. Here is the error that I get . ''The requested resource (/cs520-review/AddRubric) is not available" it seems that if we are forwarded from a servlet to a jsp page (and we still see the servlet address in address bar) and we are going to post to that servelt again it wont accept that . is that correct? , means technically we have not left the servlet yet and it can not handle a post request to itself while we are technically still in there , or I am wrong? is there any work around it , since not using this feature will force me to use Send redirect and possibly extra servelt ....
Last edited by aligh1979 at
15:00 Oct 07, 2011.
|
Vanquish39
Posts: 134
|
Posted 15:32 Oct 07, 2011 |
I assume you are getting that error inside the eclipse when you run it on the server yes? I get that all the time. Try accessing the servlet via http://localhost:8080/Projectname/Servletname via a browser. In my opinion, creating that extra servlet makes things more clearer, so you don't have to bunch up all your code in 1 servlet. Also in the <form action=""> You should name the action to the name of the servlet, if you haven't already. |
aligh1979
Posts: 121
|
Posted 16:11 Oct 07, 2011 |
I tried the regular fire fox browser ,same thing . and yes the action is the name of the server. |
Vanquish39
Posts: 134
|
Posted 16:13 Oct 07, 2011 |
Can you please post what is calling that servlet. How are you calling it? If you are doing response.sendRedirect().... it should be response.sendRedirect("AddRubric"); .... which is a servlet Last edited by Vanquish39 at
16:13 Oct 07, 2011.
|
cysun
Posts: 2935
|
Posted 16:53 Oct 07, 2011 |
No, it's not like that. Most likely you just specified a wrong URL in your form action. |
aligh1979
Posts: 121
|
Posted 17:10 Oct 07, 2011 |
Thank you , I played with it , and some how it got fixed . don't know why , but think it is just maven/tomcat bug or confusion... |