Hi all, I have a JSP page which is using a Bean. The Bean performs all the actions i.e. fetching data, storing it and displaying the same using System.out.println Now, the same data needs to be displayed on the browser. With Servlets, I'd use something like:
How can I access HttpServletResponse parameter in a JSP page, so that the same can be sent to the Bean in order to display the contents? If there is any other way to do this, please let me know. Thanks, Saket
Hi, Why not make use of the jsp:useBean functionality and access the data from the bean directly. Alternatively, create some sort of data object to hold the data you wish to display and then set it / get it from the session.
Its not what you do, its the way you say you've done it.
In the servlet use getServletConfig().getServletContext().getRequestDispatcher("jsp-page").forward(req,res) by this u r passing the request & response present in this servlet to the jsp page hope this helps