Try this:

photo = photoManager.save(photo);

Matt

On 12/4/07, davos <[EMAIL PROTECTED]> wrote:
>  I'm sure this must be a common problem for people new to AppFuse/Spring MVC
> as I am, but I can't figure out how to get my object to update and get it's
> ID after i create and save it. The relevant code in the controller is :
> photoManager.save(photo); return new ModelAndView(getSuccessView() + "?id="
> + photo.getId()); which just redirects to viewphoto.html?id=null. I have
> tried to find a refresh() method or something but to no avail. The closest
> thing i have found is this. but i don't really understand it. The AppFuse
> tutorial code seems to just redirect to a list after a new object is
> created, thus avoiding the problem. I need to get the id somehow because I
> want to use it to name an uploaded file in the controller. Any help would be
> greatly appreciated!! davo Ps. Sorry if this has been asked a million times
> - I've been searching for hours and I can't figure it out.
> ________________________________
>  View this message in context: getId() returns NULL on a newly saved
> hibernate object?
>  Sent from the AppFuse - User mailing list archive at Nabble.com.
>

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to