henryhandle
Programmer
ServletA create a form and will get input from form
and analyse it:
ServletA:
public void doPost(HttpServletRequest request,
HttpServletResponse response) throws IOException,
ServletException
{
out.println(" <form action=\"/servletA" method=\"POST\">");
out.println("<input type=text name=\"name\" size=20>
<input type=text name=\"addr\" size=20></TD>" +
//" <TD> <input type=submit Value=\"Submit\" </TD");
.............
String name = request.getParameter("name");
String addr= request.getParameter("addr");
I call this servlet from ServletB.
The problem is as soon as i call ServletA
the Servlet try to read input
(because of addr= request.getParameter("addr"); and name = request.getParameter("name")
and it aborts with error message.
how could servletA wait for input ??
i tried with this:
while( !request.getParameter("name").equals(""))
{ name = request.getParameter("name");
addr= request.getParameter("addr");
}
but it does'nt work
?
thanks
and analyse it:
ServletA:
public void doPost(HttpServletRequest request,
HttpServletResponse response) throws IOException,
ServletException
{
out.println(" <form action=\"/servletA" method=\"POST\">");
out.println("<input type=text name=\"name\" size=20>
<input type=text name=\"addr\" size=20></TD>" +
//" <TD> <input type=submit Value=\"Submit\" </TD");
.............
String name = request.getParameter("name");
String addr= request.getParameter("addr");
I call this servlet from ServletB.
The problem is as soon as i call ServletA
the Servlet try to read input
(because of addr= request.getParameter("addr"); and name = request.getParameter("name")
and it aborts with error message.
how could servletA wait for input ??
i tried with this:
while( !request.getParameter("name").equals(""))
{ name = request.getParameter("name");
addr= request.getParameter("addr");
}
but it does'nt work
?
thanks