I am trying to call a
servlet with parameter "item" and include the output to my outputstream.
res.setContentType("text/html");
PrintWriter out = res.getWriter();
out.println("hello");
RequestDispatcher rd = getServletContext().getRequestDispatcher("/servlets/xxxServlet?&item=xxx");
rd.include(req, res);
In the xxxServlet, Iam getting the parameter value for "item" using request.getParameter and printing it out as below:
PrintWriter out = res.getWriter();
out.println("item = "+request.getParameter("item"));
But I get the following output:
hello
but not the output from the xxxServlet.
If I don't give any parameter, then I get the following output:
hello item=null
How can I get the proper output "hello item=xxx" ?
thanks.