File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Struts and the fly likes two jsp's communication Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "two jsp Watch "two jsp New topic

two jsp's communication

Pradeep Adibatla
Ranch Hand

Joined: Oct 27, 2009
Posts: 336
Hi All..I want some inputs,examples,books,notes on how 2 jsp's communicate with each other or rather the right way to pass values between jsp's and setting them to UI tags etc

Say,moving from jsp1 to jsp2 and sending some data(can be a javascript value et al) prepared in jsp1 which should be set in some table-cell of jsp2 i.e as soon as jsp2 appears to user he should see the value sent from jsp1 set in the table-cell of jsp2 .

Deepak Bala

Joined: Feb 24, 2006
Posts: 6662

* Redirect to a servlet first.
* Let the servlet set the required values for JSP2 from an external source and also attach the values of JSP1 from the POST payload to a scope.
* Forward to JSP2 and display all the values.

Parameters are also an option ->

SCJP 6 articles - SCJP 5/6 mock exams - More SCJP Mocks
Pradeep Adibatla
Ranch Hand

Joined: Oct 27, 2009
Posts: 336
I am using struts-2. Will the same suffice?
Bear Bibeault
Author and ninkuma

Joined: Jan 10, 2002
Posts: 63866

Please be sure to ask Struts questions in the Struts forum. I have moved this post there for you.

[Asking smart questions] [About Bear] [Books by Bear]
I agree. Here's the link:
subject: two jsp's communication
It's not a secret anymore!