[Logo]
Forums Register Login
Passing Array ussing session
Hi all,

I wish to pass array of string via session from java class to jsp.. Please help

Thank you in advance
why you want to pass through session? what about request?
 

seetharaman venkatasamy wrote:why you want to pass through session? what about request?



Thanks for the quick reply. Sorry I am new to java .
I dont want to use scriptlets to retrive data from DB in jsp. So I tought of sending the entire records by retriving it in java class and then pass it using session and array.

What is request?

Thank you in advance
You may want to check out some basic JEE documentation.

The request is a scope that exists for the duration of the request.

To put an attribute into the request just call setAttribute(name, value) on the request.
 

David Newton wrote:You may want to check out some basic JEE documentation.

The request is a scope that exists for the duration of the request.

To put an attribute into the request just call setAttribute(name, value) on the request.



Yes i am fine with that. How to retrive data, say if there are 10 rows in the table. How do i display all of them. if I retrive them in the java class and pass them on the jsp for displaying.
use java class to get a connection to db,get the 10 rows thru a select query and set it in request,pass the ctrl to a jsp and then retrieve the values from the request and display them
 

thru sai krishna wrote:use java class to get a connection to db,get the 10 rows thru a select query and set it in request,pass the ctrl to a jsp and then retrieve the values from the request and display them




Thank you for the quick responce.
And do mean resultset.

Thank you in advance.
Wink, wink, nudge, nudge, say no more ... https://richsoil.com/cards


This thread has been viewed 1874 times.

All times above are in ranch (not your local) time.
The current ranch time is
Apr 24, 2018 23:09:26.