Stephen, It sounds like you can accomplish what you're trying to do by marking the ServiceProvider declaration in your ActionBean with @Session from the StripesStuff project. That will save sessionProvider in the HttpSession at the end of each request and restore it at the beginning of subsequent requests.
You can get the StripesStuff jar at http://sourceforge.net/projects/stripes-stuff/files/ Aaron Stephen Nelson wrote: > Hi Aaron, Ben and Grzegorz > > Thanks for the replies. I think a code snippet may be helpful as I'm > probably not explaining what I'm trying to do very well... > > @DefaultHandler > @DontValidate > public Resolution view() { > ServiceProviderContext sp = getServiceProviderContext(); > serviceProvider = getService().getServiceProvider > (sp.getServiceProviderId()); > return new ForwardResolution("/WEB-INF/jsp/serviceProvider/ > editAccount.jsp"); > } > > public Resolution update() { > ServiceProviderContext sp = getServiceProviderContext(); > telephoneNumber.setTelephoneType > (TelephoneNumber.TelephoneType.LANDLINE); > serviceProvider.addTelephoneNumber(telephoneNumber); > ServiceProviderValidationResult result = getService > ().updateServiceProvider(serviceProvider); > > if (result.isValidationSuccessful()) { > return new RedirectResolution("/service-providers/" + > getServiceProviderDisplayName()); > } else { > return getContext().getSourcePageResolution(); > } > } > > I've taken out some error handling code to cut down the line count. > What I'm trying to do is load the entity in the view method, allow the > user to modify certain fields in editAccount.jsp and then update these > changed fields along with the original unchanged data in the update > method. > > What is happening at the moment, I think, is that no state is > persisted across the two requests - that's fine and I don't expect it > to. I wonder if there is an built-in way to handle this transient > state though? I don't want to re-load the entity before the update > method as there is a small possibility that the entity may have > already been updated during the users think time and this would result > in that update being lost. > > Many thanks > > -- > Stephen > > ------------------------------------------------------------------------------ > Come build with us! The BlackBerry(R) Developer Conference in SF, CA > is the only developer event you need to attend this year. Jumpstart your > developing skills, take BlackBerry mobile applications to market and stay > ahead of the curve. Join us from November 9 - 12, 2009. Register now! > http://p.sf.net/sfu/devconference > _______________________________________________ > Stripes-users mailing list > [email protected] > https://lists.sourceforge.net/lists/listinfo/stripes-users > > ------------------------------------------------------------------------------ Come build with us! The BlackBerry(R) Developer Conference in SF, CA is the only developer event you need to attend this year. Jumpstart your developing skills, take BlackBerry mobile applications to market and stay ahead of the curve. Join us from November 9 - 12, 2009. Register now! http://p.sf.net/sfu/devconference _______________________________________________ Stripes-users mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/stripes-users
