dcsimg
Interservlet communication problem
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Aditya_Sharma
Posted On:   Wednesday, March 3, 2004 10:22 PM

While designing an ecommerce based Book selling website,i am facing a problem.I am at begginer level designing a shopping cart. I have retrieved all contents of a table Book on a servlet. They are (BookId,BookName,BookPrice,BookAuthor,BookImage) Sixth column is 'Add to my cart'.It contains checkbox for every record.I did that using out.println("") after counting number of records.When user selects any of them and click on 'Submit',i want that value of that checkbox(which have been named as BookId temselves) must go to next servlet on clicking Submit.Problem is how to achieve this. When i click on submit it should first store all values of checkboxes in an array and then pass it to next servlet where i can retrieve t   More>>

While designing an ecommerce based Book selling website,i am facing a problem.I am at begginer level designing a shopping cart.
I have retrieved all contents of a table Book on a servlet.
They are (BookId,BookName,BookPrice,BookAuthor,BookImage)
Sixth column is 'Add to my cart'.It contains checkbox for
every record.I did that using out.println("") after counting number of records.When user selects any of them and click on 'Submit',i want that value of that checkbox(which have been named as BookId temselves) must go to next servlet on clicking Submit.Problem is how to achieve this.
When i click on submit it should first store all values of checkboxes in an array and then pass it to next servlet where i can retrieve them.

   <<Less

Re: Interservlet communication problem

Posted By:   Stephen_McConnell  
Posted On:   Thursday, March 4, 2004 05:41 AM

When you have submitted your request to the first servlet, get the information you need from the request object... Create your array and then place the array in the request object by using addAttribute(Object) method.


Then, use a forward or dispatch method to the next servlet.


Stephen Mcconnell

About | Sitemap | Contact