I have a ModelDrivenInterceptor set up as follows in struts.xml: <interceptor-ref name="modelDriven"> <!-- allow actions to change the model during execution so that the view gets a new model. --> true </interceptor-ref>
My save method in my action is as follows: /** * Create or update the entity. * * @return <code>Show</code> */ public String save() { LOG.debug("save() Called"); setEntity(getDao().save(entity)); return SHOW; } The DAO is using Hibernate via JPA. However the entity is never replaced on the value stack. Digging a little further in the debugger I get to the following code on lines 114-116 of ModelDrivenInterceptor: if (item == newModel) { needsRefresh = false; } Now the debugger tells me that those two variables have different object identities. newModel has the ID of the entity set from the database save and item does not. However for some reason Java is saying that the two variables are == to each other which is clearly not the case. Definitely weird. Can anyone suggest what might be going on? My only thought is that there is some weirdness going on with the Hibernate CGLIB enhanced model objects. Peter Kelley -- View this message in context: http://www.nabble.com/ModelDrivenInterceptor-not-refreshing-model-for-Struts2-tp23227918p23227918.html Sent from the Struts - User mailing list archive at Nabble.com. --------------------------------------------------------------------- To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org