On 11/09/2004 06:26 PM Joe Germuska wrote:
I think this is exactly the point. JSF's controller model may not scale to a large application. However, in the Shale proposal, JSF's controller model is only being asked to control the view. Right now, Struts doesn't have a separate concept of a "view controller," and I am finding that a limitation. I would like a clean facility for prepopulating forms from system data which interoperates with the existing mechanism for prepopulating forms when validation fails and the user must try again. I would also like a clean mechanism for doing certain kinds of page preparation based on the destination page rather than the processing action. I feel that this cleans things up and supports a nicer separation of concerns. Neither of these is easy in Struts today, and I think the way forward is to more explicitly model a "view controller" subcomponent. I think Craig believes that JSF has already done that. I still have to find out for myself.

Joe,
have you tried the Post Redirect Get (PRG) pattern? I use it to seperate out the submit from one page from the retrieve for the next page. It required a little method on my BaseAction to append the primary key of the data onto the redirect URL, but otherwise it's simple enough and does what you want.


e.g. I want insert a hotel, and go on from there on success to add rooms.

In the simple old scenario, the insert form would submit and come back with the "add rooms" screen, which would have the URL /hotel/insert.do and have been set-up by the HotelAction class.

With PRG, on finishing the hotel/insert.do insert, the forward is a redirect to the hotel/addroom.do action.

I started doing this for the sake of the URLs. What I like about issuing a redirect is that the user then sees a comprehensible URL. I quickly found that it gives me flexibility to a completely 'OO' the actions (HotelAction and RoomAction), with all the advantages of that.


Adam


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



Reply via email to