i hava a html page and hello is my servlet
<html>
<body>
<form action="http://localhost:8080/nitin/jsnipop/hello" method="post">
<input type="text" id="foo" name="foo">
<input type="submit" value="Send" name="submit" id="submit">
</form>
</body>
</html>
and my servlet is
public class hello extends HttpServlet{
/**
*
*/
private static final long serialVersionUID = 1L;
public void doPost(HttpServletRequest req,HttpServletResponse res)throws ServletException,IOException
{
res.setContentType("text/html");
PrintWriter pw=res.getWriter();
String foo=req.getParameter("foo");
pw.println("Welcome "+foo);
}
}
now i want to send foo string variable on client side and set this as a user name my client class name is ser.java please help