struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cree <>
Subject Struts 2 And Hibernate Problem
Date Wed, 25 Jun 2008 20:56:54 GMT

I recently have been working on a struts 2 + spring 2 + hibernate system and
have come across a problem that I never have when just working on a struts 2

I have two action classes, one that prepares the jsp and populates some
selects for the user to choose from, and another that takes and processes
the information.  When the first action is invoked the result will bring it
to the tiles (type="tiles") on the struts.xml file.  The second action will
take the form information and do a search, in this instance I am using
hibernate to access the db.

I would do the search and when I get the list of persistent values I would
chain (type="chain") to the first action class with the list of persistent
objects and would then return to the tiles and the jsp showing the values
that I found on the search.  

The problem I am having here is that because of the chain (or similarly a
redirect action), the list of persistent objects will re-appear if I went
off to some other action classes and came back.  What I mean by that is if I
had a list of 10 values that I searched for and displayed them,  if I went
to some other jsp/action class and came back to that same one the same exact
10 values are being populated.  

At that point when I would return to the original jsp the value stack should
have removed them completely, which it has.  There is no trace of the list
of persistent objects on the value stack as well as not being a cache
problem.  The situation arises when the chain occurs, I have worked with
just a struts 2 system for a year now and never had this problem.   I  know
this is the case because when I get rid of the chain and invoke the tiles
from the second action class the problem goes away.

I am not too sure why these values persist throughout the session and why
they re-appear even though they are not on value stack.  I have found a very
similar problem in which this person found that the problem occured during
an action redirect at 

On a side note, just remembered, when I would want to populate the list 
after its already been populated (so the user will search once then decide
to search again) the values wouldnt change even after setting it to a new
list.  If I set that list to null first then changed it, the values would
change,  not sure if that makes much sense.

If anyone has an idea on what can be causing this I would greatly appretiate
your help.
View this message in context:
Sent from the Struts - User mailing list archive at

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message