i am coding a small demo application (jsp_demo). i have a login.jsp page which got submitted to a servlet(check) present in WEB-INF classes. i am using tomcat server, but when i click on submit button in my jsp i got an error as
"HTTP Status 404 - /check" The requested resource (/check) is not available.
my code for login.jsp and check is as follows
my web.xml is
my directory structure is---
[BPSouther: Nested directory structure in code tags] [ August 21, 2006: Message edited by: Ben Souther ]
<form method="GET" action="/check"> change the above code as <form method="GET" action="check">
This is correct. The preceeding slash tells the browser to skip your context path altogether. It would be even better to use the request object's getContextPath method to add the context path to your relative URL.
Your servlet class is NOT in a package - this will cause endless trouble so you might as well fix it now. ALL classes used in servlets and JSP should be in packages and the references in web.xml and the jsp adjusted accordingly. This is because the JVM looks for classes in the "default" (blank) package in the "current" directory, something you have no control over in the servlet environment. Bill ;)
Have you no shame? Have you no decency? Have you no tiny ad?
Download Free Java APIs to Work with Office Files and PDF