8 Replies Latest reply on Feb 5, 2014 3:35 AM by Lukasz Sroka

    Resteasy header in custom ContextMapper don't work - i think ?

    Lukasz Sroka Newbie

      Hello, like in title i have little test on adding custom header to rest response.
      I have test it with https://addons.mozilla.org/pl/firefox/addon/restclient/ and i dont see in response headers my custom header.
      Also in firebug


      here it is my custom context mapper:

      public class MyTestComposer extends RESTEasyContextMapper{



          public void mapFrom(RESTEasyBindingData source, Context context) throws Exception {


              super.mapFrom(source, context);





          public void mapTo(Context context, RESTEasyBindingData target) throws Exception {


              super.mapTo(context, target);     

              target.addHeader("test-my-head", "lol");     



      All simple app in attachment.


      I saw in Setting headers on the request of a Client REST binding. that it is possible to add this header in custommapper.


      1.  Re: Setting headers on the request of a Client REST binding.

         Keith Babo Master


      You can also implement your own context mapper to add the headers.  Or you could just set the context properties in whatever code is invoking the REST reference binding.


      What i am doing wrong ?


      SY version 1.1.0 with eap 6.1