Win a copy of Learning OpenStack Networking: Build a solid foundation in virtual networking technologies for OpenStack-based clouds this week in the Cloud/Virtualization forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Liutauras Vilda
  • Campbell Ritchie
  • Tim Cooke
  • Bear Bibeault
  • Devaka Cooray
Sheriffs:
  • Jeanne Boyarsky
  • Knute Snortum
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Ganesh Patekar
  • Stephan van Hulst
  • Pete Letkeman
  • Carey Brown
Bartenders:
  • Tim Holloway
  • Ron McLeod
  • Vijitha Kumara

Passing Array ussing session  RSS feed

 
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
 
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
 
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.
 
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.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!