Win a copy of Java Concurrency Live Lessons this week in the Threads forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

display data in same jsp  RSS feed

 
sanjay kumar
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I have 2 JSP's
a.jsp,b.jsp

a.jsp-> it has a few checkboxes with some data against it.. user selects some checkboxes and clicks next

on clicking next -> b.jsp will take those values and do some processing
will display result on the same page it will also have next button, on clicking next it should display some result on the same page.

Now i dont know how to go about it.

can someone help please
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65833
134
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Given that you have twi JSPs, saying "the same page" doesn't tell us which page you are referring to.

P.S. You shouldn't be doing processing in a JSP, that's a servlets job.
 
sanjay kumar
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Bear,

Yes I know, Its just retrieval of data based on a parameter from a class..

By the same JSP I meant b.jsp
 
Peter Johnson
author
Bartender
Posts: 5856
7
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Here is what I would do (which is not to say that this is the correct solution...).

I would have a servlet, call it B, and two beans, call them ABean and BBean. B gets the POST data from a.jsp and uses that to populate ABean, and also gets the POST data from b.jsp (from clicking next) and uses that data to populate BBean. B places the bean(s) in the request scope than redirectes to b.jsp. Then b.jsp uses the existence of ABean or BBean to determine what to display.
 
Satya Maheshwari
Ranch Hand
Posts: 368
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Not sure of your requirement but I think you can have a 3rd page to display the summary of a.jsp and b.jsp instead of displaying it in b.jsp. If that cannot be done, you could consider forwarding to the same page(b.jsp) again, this time rendering the summary as well, though I feel it is not a good approach.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!