-
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
Hello Purnima,
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.
Regards.
Hasnain.
Similar Threads
-
Replies: 0
Last Post: 04-19-2002, 07:45 AM
-
Replies: 1
Last Post: 01-26-2001, 11:37 AM
-
By Antonio Fdez. in forum Java
Replies: 3
Last Post: 10-17-2000, 06:58 AM
-
By Ewan Makepeace in forum Java
Replies: 4
Last Post: 04-08-2000, 02:18 PM
-
Replies: 1
Last Post: 03-15-2000, 04:41 PM
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
Forum Rules
|
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
|
Bookmarks