posted 14 years ago
Hello,
First off, sorry if this is posted in the wrong forum, couldn't decide between newbie, servlet/JSP or general
I'm looking for some advice on how I should be managing my objects via requests, I have several JSPs that deal with handling different parts of my objects, and I'm getting a bit confused as to how I should be passing them through the requests as I go between the pages
My main domain object is my "client", which looks as follows
My client has a number of "contacts" attached to it, there can be zero to unlimited of these.
My application has a structure similar to this
From the start, on my list of clients I can easily create a link called "edit" that passes the client Id as a parameter to my action and then looks up the object. I can easily switch between the client overview and client edit page by passing the client ID through the request parameter.
My problems come with dealing with contacts, I can display a list of the contacts OK as I use the client ID to look these up. but if I want to edit a contact that is where I struggle.
I pass the client ID and the contact ID through to the action, and lookup the client, but what should I do to ensure I get the right contact? What about issues with the contact becoming detached from the client? therefore I have trouble persisting?
The technologies I'm using are Stripes MVC framework, JPA, Hibernate, Spring, and JSPs
How would you implement the passing of objects? Is there some framework that would help with this, or am I just not understanding my current frameworks enough?
Thanks