Getting information from servlet created html
- by user541597
I have a servlet that creates an html text box and then redirects to another servlet on submit. How can I access the value of the html text box from the new servlet? I am able to access servlet variables from the new servlet but I am not aware of how to access the value of the html generated code.
thanks,
Here is the servlet that gets the text input
public class ServletB extends HttpServlet {
public void doGet(HttpServletRequest request, HttpServletResponse response)
throws IOException, ServletException
{
response.setContentType("text/html");
String value = System.getProperty("card");
PrintWriter out = response.getWriter();
out.println("<center><h1>Your preffered method of payment is "+value+"</h1><br />");
out.println("Please Enter Card Number<input type =\"text\" name = \"number\"/><form action=\"http://codd.cs.gsu.edu:9999/cpereyra183/servlet/ServletC\"><input type =\"submit\" value=\"Continue\" /><input type=\"button\" value=\"Cancel\" /></center>");
}
}}
This is the servlet the first servlet redirects to all I do is try to do is output the text input
public class ServletC extends HttpServlet {
public void doGet(HttpServletRequest request, HttpServletResponse response)
throws IOException, ServletException
{
response.setContentType("text/html");
String value = System.getProperty("card");
PrintWriter out = response.getWriter();
out.println(request.getParameter("number"));
}
}