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. 
http://forum.springframework.org/showthread.php?t=37778 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: 
http://www.nabble.com/getId%28%29-returns-NULL-on-a-newly-saved-hibernate-object--tf4946727s2369.html#a14162981
Sent from the AppFuse - User mailing list archive at Nabble.com.

Reply via email to