Servlets and JSP
My requirement is that servlet calls jsp and then there are checkboxes in jsp .After user clicks on them the same servlet continues processing. I have a ervlet that sets some attributes and then displays a jsp with the questdispatcher include method. on the jsp there are some checkboxes and i need the user to check them and return these back to the servlet exactly after the
point where the jsp was called in the first place.
I am having a problem in going about this. The request object from the servlet will set attributes and with request dispatcher include(request,response) the jsp is displayed and now after checking boxes on jsp how do i pass all of them back to the servlet. if there is a submit button it will again post to the servlet right ? but i want control to return to exactly that point. Also, if i set with response.setParameter, there is no response.getParameter on the servlet side.
please help !!
Servlet and JSP
1) First of all you should call the JSP at the very end of what you are doing in the servlet. When the user chooses what ever options are there, you should call the doGet method of the same servlet from the JSP and from the doGet method of the same servlet, you should enclose the code needed for processing after the user chooses the options in a private method which will be called from method doGet.
2) For the parameters, why dont you use an HttpSession object to pass parameters between Servlets and/or JSPs.
This is one way of doing it.I hope this helps you. If you dont, you must provide the code and explain what the code does.
Last Post: 04-19-2002, 07:45 AM
Last Post: 01-26-2001, 11:37 AM
By Antonio Fdez. in forum Java
Last Post: 10-17-2000, 06:58 AM
By Ewan Makepeace in forum Java
Last Post: 04-08-2000, 02:18 PM
Last Post: 03-15-2000, 04:41 PM
Top DevX Stories
Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL