I was able to display html form then suddenly due to some misconfiguration or something
the app start giving 404 error
attached is my app directory structure , tomcat is running fine
here is web.xml
I reinstalled tomcat and again do all the steps, I put form.html in webapps folder and put class and stuff in WEB-INF folder , but I didn't put web.xml there(I forgot to do so)
then first time form.html loads and on submit it says /Selection.do (fair enough)
but then when I again reload form.html it gives 404 error
omar al kababji wrote:you should have a directory in your webapps with a name for you web application for example "myWebApp" and then when you call form.html you should call
your structure should be like this
If you look at the image included in the start post you'll see that the application name is beer and that the files are all in the right place.
Besides the link, what is in the output and error logs of your Tomcat? A 404 error for static content could indicate an error in your web.xml
Joined: Jun 18, 2008
This is my current web.xml
I cannot submit the form, and that static form.html is having 404 error
I am having same exact configuration as given in book.
Omar Al Kababji
Joined: Jan 13, 2009
your form.html file is inside the WEB-INF directory this is wrong it should be raised up by one level, it should be a sibling for the WEB-INF directory ;). compare my file structure and yours again.
then the most obvious answer is that your application isn't deployed.
check the log of tomcat (in logs folder of tomcat, the last modified)
to see what's the problem.
besides, maybe it's the hyphen (-) that doing this problem, try deploying
the application without the hyphen (Beer_v1 for example)
Joined: Jun 18, 2008
Edit:Got it running finally
it seems that web.xml was corrupted somehow,
I redo all the modifications again and it is running fine showing off the output
Thanks guys for hearing me out
omar al kababji wrote:your form.html file is inside the WEB-INF directory this is wrong it should be raised up by one level, it should be a sibling for the WEB-INF directory ;). compare my file structure and yours again.
it's a sibling , the picture showed it that way.
and here is my 404 error which I received previously, but all is working fine now
HFSJ clearly show a hyphen, so I think it should not be a problem