Custom Date Format with jax-rs in apache cxf?

Posted by Oscar Chan on Stack Overflow See other posts from Stack Overflow or by Oscar Chan
Published on 2010-05-14T23:42:56Z Indexed on 2010/05/14 23:44 UTC
Read the original article Hit count: 286

Filed under:
|

Hi,

I have been googling to figure out how I can customize the Date format when I use jax-rs on apache CXF. I looked at the codes, and it seems that it only support primitives, enum and a special hack that assume the type associated with @ForumParam has a constructor with a single string parameter. This force me to use String instead of Date if I want to use ForumParam. it is kind of ugly. Is there a better way to do it?

@POST
@Path("/xxx")
public String addPackage(@FormParam("startDate") Date startDate)
    {
      ...
    } 

Thanks

© Stack Overflow or respective owner

Related posts about apache-cxf

Related posts about jax-rs