I am passing data from ajax call to a specific JSP page. My login.jsp is receiving values. this is my jsp
<html>
<head>
<title>Life Settlements</title>
</head>
<body>
<form action="login.ind" method="post">
<%
String username = request.getParameter("loginUserName");
System.out.println("username in jsp\t"+username);
String password = request.getParameter("loginPaswd");
%>
</form>
</html>
The JSP is as getting username and password values. How do I pass this values to servlet.
My web.xml is as follows
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" id="WebApp_ID" version="2.5">
<servlet>
<servlet-name>ServletR</servlet-name>
<servlet-class>com.ind.servlet.RServlet</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>ServletR</servlet-name>
<url-pattern>*.ind</url-pattern>
</servlet-mapping>
<welcome-file-list>
<welcome-file>login.html</welcome-file>
</welcome-file-list>
</web-app>
My servlet has service method as follows
protected void service(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
String uri=request.getRequestURI();
System.out.println(uri);
if (uri.endsWith("login.ind")) {
page=loginAction.verifyUser(request, response);
}}