On 14-12-2008 at 16:00, Simon wrote:
> On Sat, Dec 13, 2008 at 12:10 AM, Ben Gunter <[email protected]> wrote:
> > It depends on the situtation, but I usually try to avoid using on="event" on
> > the @Validates and instead just turn off validation using @DontValidate or
> > @DontBind on the event handlers where I don't need validation. E.g.,
> >
> > @DontBind public Resolution get() { ... }
> 
> Thanks ... it's great to know how more experienced people do things.
> However if the "get" needs some parameters validated - then we are
> back to square one, I think, no?  (I suppose you might start to
> question why I'm putting these things in the same action bean to start
> with, and that might be legitimate ...)

A "get" has no source page to return to, so validation errors are not
possible. Therefore, I generally annotate the handlers for such events with
@DontValidate at least (or @DontBind when I don't want parameters).

The trick is therefore, to ensure that every possible HTTP parameter value is
parsable. The is, the parameters are all a String (not Date, Integer or any
other type that may fail to convert). The worst case you have then to prepare
for is a "not found" error page.


Oscar

-- 
   ,-_
  /() ) Oscar Westra van holthe - Kind      http://www.xs4all.nl/~kindop/
 (__ (
=/  ()  DRM "manages access" in the same way that a jail "manages freedom".

------------------------------------------------------------------------------
SF.Net email is Sponsored by MIX09, March 18-20, 2009 in Las Vegas, Nevada.
The future of the web can't happen without you.  Join us at MIX09 to help
pave the way to the Next Web now. Learn more and register at
http://ad.doubleclick.net/clk;208669438;13503038;i?http://2009.visitmix.com/
_______________________________________________
Stripes-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/stripes-users

Reply via email to