This week's giveaway is in the JDBC forum.
We're giving away four copies of Java Database Connections & Transactions (e-book only) and have Marco Behler on-line!
See this thread for details.
Win a copy of Java Database Connections & Transactions (e-book only) this week in the JDBC 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:
  • Campbell Ritchie
  • Devaka Cooray
  • Knute Snortum
  • Paul Clapham
  • Tim Cooke
Sheriffs:
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Bear Bibeault
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Ron McLeod
  • Piet Souris
  • Frits Walraven
Bartenders:
  • Ganesh Patekar
  • Tim Holloway
  • salvin francis

Does ValueStack overflows at some time  RSS feed

 
Ranch Hand
Posts: 188
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a very basic question that could be really silly but I am curious to know this

Suppose we have one web application, where several objects are put into Value stack during its operation. My question, is does Value stack overflow at some time?

Please guide me if I am wrong.
 
Bartender
Posts: 9559
12
Linux Mac OS X Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Stack overflow refers to a particular condition, that is the call stack has exceeded the maximum allowable size, usually due to recursion.
The Value Stack in Struts 2 is a different kind of mechanism, just holding the values for a single HTTP request, so I would venture to say that in normal use it cannot "overflow".
 
MaheshS Kumbhar
Ranch Hand
Posts: 188
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Joe
Does this mean, if one action class puts an one object onto value stack and its result page jsp displays that object put onto top of value stack; this way one http request response completes. Now user makes another request by clicking some link on that jsp page which will invoke different action class and in turn will act as new http request. Now my question is, cant this new action's result type(JSP page) access the object put on value stack by first action?
 
Joe Ess
Bartender
Posts: 9559
12
Linux Mac OS X Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
No it cannot. If you want to persist values between requests, you'll need to use the session or some other persistence mechanism (file, database, etc.).
 
MaheshS Kumbhar
Ranch Hand
Posts: 188
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If we need to maintain the session, so that different actions results can access the objects created by one action, then these objects need to be saved in session object or in the value stack itself?
And once again I want to inturrupt the same topic.
I had read on apache struts site that said,
"If you are looking for an object then Struts will look into the whole value stack for the object. If you directly specify a property, then its looked only into the object which is on top of the value stack."

Here they told that, struts will look into the whole value stack for the object we specify until it finds, then is this information is with respect to single http request response cycle.
 
Joe Ess
Bartender
Posts: 9559
12
Linux Mac OS X Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

MaheshS Kumbhar wrote:If we need to maintain the session, so that different actions results can access the objects created by one action, then these objects need to be saved in session object or in the value stack itself?



I think I said: "If you want to persist values between requests, you'll need to use the session or some other persistence mechanism". The ValueStack only holds values for a single request.

MaheshS Kumbhar wrote:
Here they told that, struts will look into the whole value stack for the object we specify until it finds, then is this information is with respect to single http request response cycle.



Again, the ValueStack only holds values for a single request.
 
Can you shoot lasers out of your eyes? Don't look at this tiny ad:
how do I do my own kindle-like thing - without amazon
https://coderanch.com/t/711421/engineering/kindle-amazon
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!