Calling Servlet From Html Form, But Servlet Is Never Invoked
Iam calling servlet from html form,servlet takes the form data and it will insert that form data into database.But when i click the submit button error page is coming.please help w
Solution 1:
check web.xml
file of your project, you have to registrate your servlet there.check this also
use <form action="/login" method="post" >
in html
and
in web.xml
<servlet-class>your.class.package.Loginservlet</servlet-class></servlet>
Solution 2:
As you look into your servlet class, there is no package
defined, which is required. And map that class with package(mean fully qualified name) in <servlet-class/>
tag.
Another thing is you are setting action to url servlet/LogininServlet
, but given different url in <url-pattern/>
tag, which is wrong. you can simply set the form action to login
Solution 3:
everything is fine....in the html page use action="./login".........it will work i have done the same
Post a Comment for "Calling Servlet From Html Form, But Servlet Is Never Invoked"