aspose file tools*
The moose likes JSP and the fly likes passing values between jsp pages Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSP
Bookmark "passing values between jsp pages" Watch "passing values between jsp pages" New topic
Author

passing values between jsp pages

bishal chhetri
Greenhorn

Joined: Apr 11, 2012
Posts: 4
hi,
i have 2 jsp page bill.jsp and coll.jsp ;
there is 2 button in bill.jsp when first is clicked controll is passed to coll.jsp where only pure java code is written to insert data to db,
and when 2nd button is clicked coll.jsp have to extract data from db, which i have done by:

Connection conn=null;
Statement stat=null;
ResultSet rs=null;
stat=conn.creatstatement();
String retrivingqry="SELECT * FROM Menu1";
rs=stat.executeQuery(retrivingqry);

now i want to pass this rs back to bill.jsp to manipulate this data and show in tabular form;


so please can anybody help me to send this rs using pure java code in coll.jsp to send to bill.jsp,

and recive this data in bill.jsp (note: no need pure java code in bill.jsp)

please help me i am in hurry,
thanks for your response
Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 19762
    
  20

bish chh wrote:please help me i am in hurry,

Please EaseUp.

You need to check out how attributes work. You can't use the page scope, so you should focus on request scope or session scope.
bishal chhetri
Greenhorn

Joined: Apr 11, 2012
Posts: 4
Rob Spoor wrote:
bish chh wrote:please help me i am in hurry,

Please EaseUp.

You need to check out how attributes work. You can't use the page scope, so you should focus on request scope or session scope.



thanks for response, but please can you teach me by showing example of my problem
Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 19762
    
  20

bishal chhetri wrote:
Rob Spoor wrote:
bish chh wrote:please help me i am in hurry,

Please EaseUp.

You need to check out how attributes work. You can't use the page scope, so you should focus on request scope or session scope.



thanks for response, but please can you teach me by showing example of my problem

jsp attributes example. Shouldn't be too hard to find a few examples.
bishal chhetri
Greenhorn

Joined: Apr 11, 2012
Posts: 4
Rob Spoor wrote:
bishal chhetri wrote:
Rob Spoor wrote:
bish chh wrote:please help me i am in hurry,

Please EaseUp.

You need to check out how attributes work. You can't use the page scope, so you should focus on request scope or session scope.



thanks for response, but please can you teach me by showing example of my problem

jsp attributes example. Shouldn't be too hard to find a few examples.




no examples found in google for my problems so i have posted hear;
please any one help me
Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 19762
    
  20

If you haven't found anything you're not looking hard enough. There are thousands, if not millions, of examples on how to use session and request attributes.
Amit Goda
Ranch Hand

Joined: Jan 21, 2012
Posts: 37

What i would suggest use some common ground for passing data such as JSON.

Store your Db data into jsonArray and send that array to the browser. The data which browser receives it is in the form javascript array so you can use javascript to obtain the data you require.


AMiT
 
jQuery in Action, 2nd edition
 
subject: passing values between jsp pages