|
From: March, A. <am...@so...> - 2005-04-21 18:54:53
|
> -----Original Message----- > From: spr...@li... > [mailto:spr...@li...] On Behalf > Of Seth Ladd > Sent: Thursday, April 21, 2005 11:13 AM > To: spr...@li... > Subject: Re: [Springframework-developer] Any plans to add support for > multiple handlers per request >=20 > On 4/21/05, March, Andres <am...@so...> wrote: > > Thanks for the reply. I am interested in webflow but wow there is a lot > > of stuff in there. I was not sure that it was focused on multiple > > actions per request. I thought it was generally for multipage actions. >=20 > Using webflow, you would configure multiple <action>'s to string > together, finally landing on a <view>. So it's a simple way to model > a flow diagram (often coming from management) as a webflow workflow. > It's actually very simple to setup. If you understand Spring MVC then > setting up webflow will be very straight forward. Cool! >=20 > > Basically I just want to call 1-to-many service methods for a single > > request. I want to be able to configure this in the app-context > > preferably, so that I don't have to create a controller for every > > request. I opened SPR-871 to track this stuff. I attached some code > > that basically does what I want but is kinda ugly. >=20 > Ahh... so you want to bind N service calls directly to a request > without a controller? How would you marshall request parameters into > the service layer and back? This is the job for the controller, imho. > So the controller is pretty thin, but does glue my service layer to > the web mvc world. Definitely the dealing with request parameters is the toughest part but not insurmountable. And if you have hundreds of requests that just return some data, it is well worth the time. I think the Binder can solve many of these problem. The main type of binder I'm interested in is one that basically creates a HashMap derived object to represent the query parameters. This would be able to support multivalued, ranges, and other constraints. But other binders could be configurable that could handle any type of service method parameters. Although I think the QueryBinder I created is great for many and complex parameters, a Binder could be written that inspects the method signature and works the same way the command objects are bound. Anyway this could be a long conversation but I hope this type of thing is valuable to more than just me. I already have written stuff for our needs but making it more generic for others would be nice.=20 >=20 > If this is what you want, webflow will still require you to write an > Action method for each step along the way. >=20 > > > > Then I thought it would be simpler if multiple controllers/handlers > > could be specified for each request. I could easily make a generic > > controller bean that would have a property to know which service method > > to call and would just stick the result in the model. At the end of all > > those, a final controller would return the ModelAndView. >=20 > Again, how do you know what the method parameters would be for each > service call? A binder implementation like I describe above. >=20 > > > > I guess it would be nice to use webflow if it already has this > > capability but I hope it is not too much trouble to set up. >=20 > Now that you have explained this, webflow (afaik) does not have > exactly this feature. You will still need to write a method that > handles the Action, taking a RequestContext and returning an Event. >=20 I know there would be some work to do but I guess I'm looking for the best extension point and if it is useful to others. I'd much rather use something more people work on then just me. I tend to have bugs in my code ;) I have run across this problem often but I guess if most of your app deals with POSTs, then this type of thing would not be of much use. I think large reporting applications would be a good example of when this functionality would be useful. > Seth >=20 >=20 > ------------------------------------------------------- > SF email is sponsored by - The IT Product Guide > Read honest & candid reviews on hundreds of IT Products from real users. > Discover which products truly live up to the hype. Start reading now. > http://ads.osdn.com/?ad_ide95&alloc_id=14396&op=3Dick > _______________________________________________ > Springframework-developer mailing list > Spr...@li... > https://lists.sourceforge.net/lists/listinfo/springframework-developer |