i m writing user registration page. i am getting HTTP Status 405 - HTTP method POST is not supported by this URL error though i have overwritten the doPost method
help me out through this Thanks
this is my registration.jsp
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Registration</title>
</head>
<body>
<form action="RegistrationServlet" method="post">
<tr>
<td>First Name</td>
<td><input type="text" name="fname" value="" /></td>
</tr>
<tr>
<td>Last Name</td>
<td><input type="text" name="lname" value="" /></td>
</tr>
<tr>
<td>Email</td>
<td><input type="text" name="email" value="" /></td>
</tr>
<tr>
<td>User Name</td>
<td><input type="text" name="uname" value="" /></td>
</tr>
<tr>
<td>Password</td>
<td><input type="password" name="pass" value="" /></td>
</tr>
<tr>
<td><input type="submit" value="Submit"></td>
<td><input type="reset" value="Reset"></td>
</tr>
<tr>
<td colspan="2"> Already registered !!<a href="Login.jsp">Login here</a></td>
</tr>
</form>
</body>
</html>
this is my servlet
public class RegistrationServlet extends HttpServlet {
public RegistrationServlet()
{
}
public void doPost(HttpServletRequest request,HttpServletResponse response) throws ServletException, IOException
{
String firstName=request.getParameter("firstName");
String lastName=request.getParameter("lastName");
String email=request.getParameter("email");
String userName=request.getParameter("userName");
String password=request.getParameter("password");
RegistrationBean registrationBean =new RegistrationBean();
registrationBean.setFirstName(firstName);
registrationBean.setLastName(lastName);
registrationBean.setEmail(email);
registrationBean.setUserName(userName);
registrationBean.setPassword(password);
}
}
This is the web.xml
<display-name>MVC</display-name>
<welcome-file-list>
<welcome-file>Login.jsp</welcome-file>
</welcome-file-list>
<servlet>
<description></description>
<display-name>LoginServlet</display-name>
<servlet-name>LoginServlet</servlet-name>
<servlet-class>com.mvc.controller.LoginServlet</servlet-class>
</servlet>
<servlet>
<description>Registraion page</description>
<display-name>RegistrationServlet</display-name>
<servlet-name>RegistrationServlet</servlet-name>
<servlet-class>com.mvc.controller.RegistrationServlet</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>LoginServlet</servlet-name>
<url-pattern>/LoginServlet</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>RegistrationServlet</servlet-name>
<url-pattern>/RegistrationServlet</url-pattern>
</servlet-mapping>