When i run the jsp , and click on submit button , I am getting the 404 errorr , the url is displayed as "http://localhost:8100/LoginServlet"
But the correct url should be http://localhost:8100/custTest/LoginServlet ...where should I make this change so that i dont get the error and the servlet gets invoked ?
I have been trying hard to call a servlet from a jsp.. I have not been able to do it.. Please help ...
Got the below when i click submit on the jsp page. I find the servlet class in the same pakcage (directory) as the source java file. But the server does not picke up this class file .. did i miss any configuration ?
Ron Ingram wrote::renaming the url mapping from /Test to /LoginServlet in your web.xml.
What would that accomplish?
If you are using the absolute path, you probably need to use the actual servlet name vs. the url mapping because you are outside the context path.
Huh? "outside the context path"? There's no such thing. Anything within the web application is by definition "inside the context path".
The servlet name should not be used; that's what mappings are for.
It's still unclear what the actual issue is because the OP hasn't been very forthcoming with info.
Joined: Mar 11, 2011
Well, I had a very similar issue before and realized if you navigate from jsp to jsp using href etc, without going through a controller servlet, the web.xml mappings are broken and you must use the absolute path to servlets. In the initial post, the OP is trying to use the web.xml mapping. I wasn't sure if this was the same issue I had, but for lack of better terms, the web.xml controls the context of your web app and if that gets broken and you must use absolute mappings.. that also conflicts with the MVC architecture as some argued to me.. maybe i'm wrong
If the original url mapping set forth in the web.xml file wasn't working, mapping to it using an absolute path will probably not generate the desired results as well.
the url for my servlet is : http://localhost:8200/custASG/LoginServlet When i tried accessing this url directly on a web browser , I was gettign the same exception.
Also when i made some changes to jsp file , rebuild my project and reatarted the server, the server is still picking up the old jsp.
any idea why this could hapen and why my servlet is not getting picked up ?
Joined: May 22, 2011
I deleted the server and created a new one ....I got the jsp changes to work ... whatever changes i make on the jsp , its getting picked up the next time i restart the server ,,but when i click on the submit button on jsp , the url on the browser is