I think I know Tim's response to this: He'd say that by having a TypeConverter registered for the "id" field on your action, when the property is applied you could pull in the proper object.
Patrick Lightbody Autoriginate, Inc. 503-488-5402 http://www.autoriginate.com [EMAIL PROTECTED] "Intelligent testing made convenient" On Oct 25, 2006, at 1:32 PM, Paul Barry wrote: > Well, it would be nice to be able to do something after the url > parameters are bound, but before the request parameter binding. So in > the example I posted, /user/{id} would make the id property of the > action bean get set, so then I could use that to load/hydrate my user > object before the request parameters are bound. What do you think? > > On 10/25/06, Tim Fennell <[EMAIL PROTECTED]> wrote: >> Hey Paul, >> >> To say that there's working being done on this would be a stretch. >> But I have good intentions ;) STS-262 is already targeted for >> Stripes 1.5, and I just went in and set the same for STS-268. >> >> My current thinking is that this wouldn't really be a separate stage >> as that would get overly complicated very quickly, but simply that in >> the future the action resolver will be able to pull things out of the >> URL and add them to the set of parameters before any binding takes >> place. >> >> This implies a fairly substantial change to all the places Stripes >> generates URLs, to then delegate to the ActionResolver to map a URL + >> params back to a final URL. The stripes:url tag you suggest already >> exists, it will just need some tinkering :) >> >> -t >> >> On Oct 25, 2006, at 2:45 PM, Paul Barry wrote: >> >>> Just wondering if any work is being done related to these JIRA >>> requests: >>> >>> http://mc4j.org/jira/browse/STS-262 >>> http://mc4j.org/jira/browse/STS-268 >>> >>> This the UrlBuilder stuff. I think it would be great to add >>> this. As >>> James Strachan suggested, it would be great if there is a >>> LifecycleStage for UrlParameter binding. This would make CRUD-type >>> action beans easier to code, because you could just do this: >>> >>> @UrlBinding(/user/{id}) >>> public class UserActionBean implements ActionBean { >>> >>> private Long id; >>> private User user; >>> >>> @DefaultHandler >>> public Resolution get() { >>> return new ForwardResolution("/WEB-INF/views/user.jsp"); >>> } >>> >>> public Resolution save() { >>> >>> } >>> >>> @Before(stage=LifecycleStage.UrlParameterBinding) >>> public void loadUser() { >>> if(id != null) { >>> user = userService.get(id); >>> } >>> } >>> >>> } >>> >>> Or the safer, more verbose way: >>> >>> @UrlBinding(/user/{event}/{id}) >>> public class UserActionBean implements ActionBean { >>> >>> private Long id; >>> private User user; >>> >>> public Resolution add() { >>> return new ForwardResolution("/WEB-INF/views/user.jsp"); >>> } >>> >>> public Resolution edit() { >>> return new ForwardResolution("/WEB-INF/views/user.jsp); >>> } >>> >>> public Resolution create() { >>> userService.create(user); >>> return new RedirectResolution(SomeOtherActionBean.class); >>> } >>> >>> public Resolution update() { >>> userService.update(user); >>> return new RedirectResolution(SomeOtherActionBean.class); >>> } >>> >>> @Before(stage=LifecycleStage.UrlParameterBinding, on= >>> {"edit","update"}) >>> public void loadUser() { >>> //Will throw exception if id is null or user is not found >>> user = userService.get(id); >>> } >>> >>> } >>> >>> To support this, will there be some kind of stripes url tag that >>> will >>> allow you to generate a url to this event? Maybe like this: >>> >>> <stripes:url class="com.mycompany.stripes.UserActionBean"> >>> <stripes:urlParam name="id" value="${user.id}"/> >>> <stripes:urlParam name="event" value="edit"/> >>> </stripes:url> >>> >>> -------------------------------------------------------------------- >>> -- >>> --- >>> Using Tomcat but need to do more? Need to support web services, >>> security? >>> Get stuff done quickly with pre-integrated technology to make your >>> job easier >>> Download IBM WebSphere Application Server v.1.0.1 based on Apache >>> Geronimo >>> http://sel.as-us.falkag.net/sel? >>> cmd=lnk&kid=120709&bid=263057&dat=121642 >>> _______________________________________________ >>> Stripes-development mailing list >>> [email protected] >>> https://lists.sourceforge.net/lists/listinfo/stripes-development >> >> >> --------------------------------------------------------------------- >> ---- >> Using Tomcat but need to do more? Need to support web services, >> security? >> Get stuff done quickly with pre-integrated technology to make your >> job easier >> Download IBM WebSphere Application Server v.1.0.1 based on Apache >> Geronimo >> http://sel.as-us.falkag.net/sel? >> cmd=lnk&kid=120709&bid=263057&dat=121642 >> _______________________________________________ >> Stripes-development mailing list >> [email protected] >> https://lists.sourceforge.net/lists/listinfo/stripes-development >> > > ---------------------------------------------------------------------- > --- > Using Tomcat but need to do more? Need to support web services, > security? > Get stuff done quickly with pre-integrated technology to make your > job easier > Download IBM WebSphere Application Server v.1.0.1 based on Apache > Geronimo > http://sel.as-us.falkag.net/sel? > cmd=lnk&kid=120709&bid=263057&dat=121642 > _______________________________________________ > Stripes-development mailing list > [email protected] > https://lists.sourceforge.net/lists/listinfo/stripes-development ------------------------------------------------------------------------- Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642 _______________________________________________ Stripes-development mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/stripes-development
