Hi On Thu, Dec 30, 2010 at 4:46 PM, drekbour <[email protected]> wrote:
> Sorry for self-reply but I have checked the code (2.3.1) and this is > because Date *does* have a String constructor - which fails to parse the > provided input and errors out. thanks for looking into it - it's helpful. > If I have explicitly registered a > handler for Date then either > a) it should be attempted after the Date(String) before returning a > failure > b) it should be used in preference to the Date(String) > > I would think (b) is correct as there must be cases where users will > want to override a default behaviour. > > I probably agree. If the user registers a ParameterHandler which does exactly what constructors or factory methods accepting Strings are supposed to do then clearly a user is willing to affect the default behaviour. However I might probably start first with optionally checking the handlers in case of exceptions thrown from constructors like SomeType(String) or SomeType.fromString() thanks, Sergey > On Thu, 30 Dec 2010 08:29 -0800, "drekbour" <[email protected]> > wrote: > > There was a thread a while back on this > > > http://cxf.547215.n5.nabble.com/ParameterHandler-not-invoked-for-Date-parameter-tt2267734.html#a2839025 > > > > I copied the same handler code but the same issue doesn't seem to be > > resolved > > @QueryParam("updated") Date updated > > is not being picked up by > > <jaxrs:providers> > > <bean class="x.ISO8601TimestampParameterHandler" /> > > </jaxrs:providers> > > > > The class signature is: public class ISO8601TimestampParameterHandler > > implements ParameterHandler<Date> > > > > Of course the temporary (ugly) workaround is to take a string param then > > run it through the same method in the server code but I'm sure we'd > > rather not leave it like this. > > > > Has anyone got a working example? > > > > -- > > http://www.fastmail.fm - The way an email service should be > > > > > > -- > http://www.fastmail.fm - Send your email first class > >
