Win a copy of Escape Velocity: Better Metrics for Agile Teams this week in the Agile and Other Processes 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Tim Cooke
  • Paul Clapham
  • Jeanne Boyarsky
Sheriffs:
  • Ron McLeod
  • Frank Carver
  • Junilu Lacar
Saloon Keepers:
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Al Hobbs
  • Carey Brown
Bartenders:
  • Piet Souris
  • Frits Walraven
  • fred rosenberger

Does ValueStack overflows at some time

 
Ranch Hand
Posts: 188
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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: 9626
16
Mac OS X Linux Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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: 9626
16
Mac OS X Linux Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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: 9626
16
Mac OS X Linux Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Ever since I found this suit I've felt strange new needs. And a tiny ad:
the value of filler advertising in 2021
https://coderanch.com/t/730886/filler-advertising
reply
    Bookmark Topic Watch Topic
  • New Topic