struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Nick Broadhurst <hou1...@gmail.com>
Subject Re: Editing a JPA entity
Date Thu, 07 Jan 2016 14:23:24 GMT
Just to make sure - you are POSTing the object back to the action and THEN
merging the entity correct? Not just calling the merge function in the
action from the page? Sorry, I had to ask because it sort of sounds like
that is what you are saying. I am using Struts2 and JPA and I routinely
post objects (entities) to an action and use merge to update the entity.

On Thu, Jan 7, 2016 at 3:31 AM, Christoph Nenning <
Christoph.Nenning@lex-com.net> wrote:

> >
> > Christoph I understand why this happens, I was simply asking if there
> was a
> > better way to do this using some struts session magic or such. Seems
> there
> > isn't so I'll just do it the old long winded way.
> >
>
> If you want to store attached entities in session you can make your
> actions SessionAware:
> http://struts.apache.org/docs/http-session.html
>
> Of course that means you introduce state on your server which causes lots
> of problems.
>
>
> If you want to keep your app stateless struts can help you with loading
> and updating entities via the "paramsPrepareParamsStack".
>
> You can read a little about it here:
> http://struts.apache.org/docs/interceptors.html
>
>
>
> Regards,
> Christoph
>
>
>
> This Email was scanned by Sophos Anti Virus
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message