Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Does ValueStack overflows at some time

 
MaheshS Kumbhar
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.
 
Joe Ess
Bartender
Posts: 9319
10
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: 9319
10
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: 9319
10
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic