• Post Reply Bookmark Topic Watch Topic
  • New Topic

Passing Array ussing session

 
Mahesh Lohi
Ranch Hand
Posts: 151
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,

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

Thank you in advance
 
Seetharaman Venkatasamy
Ranch Hand
Posts: 5575
Eclipse IDE Java Windows XP
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
why you want to pass through session? what about request?
 
Mahesh Lohi
Ranch Hand
Posts: 151
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
David Newton
Author
Rancher
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Mahesh Lohi
Ranch Hand
Posts: 151
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
thru sai krishna
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Mahesh Lohi
Ranch Hand
Posts: 151
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!