[jboss-jira] [JBoss JIRA] (WFLY-10616) ContextResolver doesn't work

R Searls (JIRA) issues at jboss.org
Thu Jun 28 09:55:00 EDT 2018


    [ https://issues.jboss.org/browse/WFLY-10616?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13598382#comment-13598382 ] 

R Searls commented on WFLY-10616:
---------------------------------

I have tested test.war on wfly-12.0.0.Final and wlfy-13.0.0.Final but have not been able to reproduce the problem.  In both cases I used curl to call the service like this,
{code:java}
curl -X GET http://localhost:8080/test
{code}
It returned this value,

{code:java}
{"date":"1969-12-31"}
{code}




> ContextResolver doesn't work
> ----------------------------
>
>                 Key: WFLY-10616
>                 URL: https://issues.jboss.org/browse/WFLY-10616
>             Project: WildFly
>          Issue Type: Bug
>          Components: REST
>    Affects Versions: 13.0.0.Final
>            Reporter: George Trudeau
>            Assignee: R Searls
>             Fix For: 14.0.0.CR1
>
>         Attachments: test.war
>
>
> I have a simple ContextResolver to set Date serialization format for my JAX-RS service, it works on 12.0.0.Final but it doesn't anymore on 13.0.0.Final :
> {code:java}
> @Provider
> public class DateResolver implements ContextResolver<ObjectMapper>
> {
>     private final ObjectMapper mapper;
>     public DateResolver()
>     {
>         mapper = new ObjectMapper();
>         mapper.setDateFormat(new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ssZ"));
>         mapper.disable(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS);
>     }
>     @Override
>     public ObjectMapper getContext(Class<?> type) { return mapper; }
> }
> {code}
> The {{getContext}} method isn't called on 13.0.0.Final.



--
This message was sent by Atlassian JIRA
(v7.5.0#75005)


More information about the jboss-jira mailing list