• Post Reply Bookmark Topic Watch Topic
  • New Topic

how much data we can set as attributes in request.

 
Praveen Kumar
Ranch Hand
Posts: 133
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I am storing the object in request as request.setAttribute("name",obj).

The object is List consissts of instances.Now these instances are below 100.But in future it can reach 2000 instances.

my doubt is can we store a object which is List consists of 2000 instances.

pls anybody help me !!

Thanks in advance.
Praveen
 
Rakesh Suman
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
u are right instances of objects are stored.
actually actually objects are stored in jvm memory heap parts.
so number of instances depends on heap size of jvm
 
Adeel Ansari
Ranch Hand
Posts: 2874
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Technically you are binding the list object as a request attribute.
And simply likely, yes you can. But again depends on the heap size of JVM.
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
pdommara Kumar and Rakesh Suman,

Welcome to JavaRanch!

In an effort to help you get the most from our forums, we've compiled a
list of tips for asking questions here. You can find the list in our
FAQ section here.
In particular please see:
UseRealWords

Abbreviations such as "u" or "ur" in
place of "you" and "you are" or "you're" confound language translation software making
it hard for our non-English speaking members to read your posts.
"plz" is not a word in the English language.

Again, welcome to JavaRanch and good luck with your question.
-Ben
 
Cameron Wallace McKenzie
author and cow tipper
Saloon Keeper
Posts: 4968
1
Hibernate Spring Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Storing objects in the request is preferable to storing it in the HttpSession. Since the request is purged as soon as a response is sent back to the client, the lifespan of that stored object will be relatively short.

2000 objects is alot though. Sometimes querying a temporary database table for data, when you need it, isn't such a bad idea.

Cheers!

-Cameron McKenzie
 
Praveen Kumar
Ranch Hand
Posts: 133
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for Your reply !


Right now i am storing almost 100 instances, But in future it can increase size, Thats why i posted in these forum. or else we have any alternative mechanisam to send the large objects to the view !!


Thanks in Advance.
Praveen.
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65529
105
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
There is no alternative mechansim needed. if you've already got the data in memory, it's not a significant extra burden to tack them onto the request. The data will not get copied; the already existing data will simple be referenced from the request.

The thing to be sure about is that you are only creating and sending data that is absolutely neccessary.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!