DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 2 of 2

Thread: Servlets and JSP

Hybrid View

  1. #1
    Join Date
    Dec 2005

    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 !!

  2. #2
    Join Date
    Aug 2005

    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.

Similar Threads

  1. Sessions between servlets and Jsp
    By Halldor in forum Java
    Replies: 0
    Last Post: 04-19-2002, 07:45 AM
  2. Replies: 1
    Last Post: 01-26-2001, 12:37 PM
    By Antonio Fdez. in forum Java
    Replies: 3
    Last Post: 10-17-2000, 06:58 AM
  4. ASP vs JSP, Servlets vs WebClass
    By Ewan Makepeace in forum Java
    Replies: 4
    Last Post: 04-08-2000, 02:18 PM
  5. Replies: 1
    Last Post: 03-15-2000, 05: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
HTML5 Development Center
Latest Articles
Questions? Contact us.
Web Development
Latest Tips
Open Source

   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center