users@jersey.java.net
[Jersey] Re: Date serialization format
This message
: [
Message body
] [ More options (
top
,
bottom
) ]
Related messages
: [
Next message
] [
Previous message
] [
In reply to
]
Contemporary messages sorted
: [
by date
] [
by thread
] [
by subject
] [
by author
] [
by messages with attachments
]
From
: Tatu Saloranta <
tsaloranta_at_gmail.com
>
Date
: Fri, 18 Nov 2011 15:39:40 -0800
On Fri, Nov 18, 2011 at 1:40 AM, Sadokhin, Vasiliy
<vasiliy_at_lionhearth.com> wrote:
> Hello
> Is there way to specify JSON response date format?
> The default template is "yyyy-MM-dd'T'HH:mm:ss.SSSZ". But I need another.
> I tried advices from that
>
http://stackoverflow.com/questions/4428109/jersey-jackson-json-date-serialization-format-problem-how-to-change-the-form discussion
,
> but it didn't help me to change date format. Is it possible?
Just configure ObjectMapper with the date format you want:
objectMapper.setDateFormat(new SimpleDateFormat(...));
and that's it. Assuming you use POJO mapping.
-+ Tatu +-
This message
: [
Message body
]
Next message
:
Sigmar Muuga: "[Jersey] Uploading file does not produce needed type of response"
Previous message
:
Leonardo Silveira: "[Jersey] Re: Date serialization format"
In reply to
:
Sadokhin, Vasiliy: "[Jersey] Date serialization format"
Contemporary messages sorted
: [
by date
] [
by thread
] [
by subject
] [
by author
] [
by messages with attachments
]