Custom Header Problem

Showing 1-10 of 10 messages
Custom Header Problem Zahir Hamroune 11/3/11 6:40 AM
Hello every one,
j have a problem with custom header, my code bellow

//Client with RestyGWT
Map<String, String> headersMap = new HashMap<String, String>();
headersMap.put("X-CustomHeader", "123456789...");
Resource resource = new Resource(url, headersMap);

//Server
in my filter, when inspecting the request

String customHeader = request.getHeader("X-CustomHeader");

customHeader still null;

how can i send a custom header?





Re: [resty-gwt] Custom Header Problem Demostenes1509 11/3/11 6:56 AM
Install firebug and check if parameter X-CustomHeader is present in outcoming header. It will help you detecting where is the problem, in browser or servlet.

   Regards !

2011/11/3 Zahir Hamroune <hamro...@sfeir.com>

Re: [resty-gwt] Custom Header Problem Zahir Hamroune 11/3/11 7:13 AM
I found @HeaderParam, adding it to signature method, it works perfect like
@GET void someMethod(@HeaderParam("X-CustomHeader") String customHeader, MethodCallback....);
thanks for reply, but i will try with firebug/Chrome inspection.

2011/11/3 Maximiliano Carrizo <mcar...@gmail.com>



--
Mr. Zahir Hamroune
Ingénieur Etude & Développement Web RIA
GWT - Java/J2ee - Méthode Scrum

Re: [resty-gwt] Custom Header Problem Demostenes1509 11/3/11 7:17 AM
Personally, I add header parameters with Resty-GWT in this way:


resource.get().header(Constants.CITI_TOKEN, sessionToken).timeout(TIMEOUT);


And always works !
Re: [resty-gwt] Custom Header Problem Zahir Hamroune 11/3/11 7:39 AM
I can confirm that using your method there is no param headres displayed in Firebug, but when using @HeaderParam, it appears, so??
i'm using RestyGWT 1.2

2011/11/3 Maximiliano Carrizo <mcar...@gmail.com>
Re: [resty-gwt] Custom Header Problem Demostenes1509 11/3/11 7:42 AM
Trick is to do this:

Method method = resource.get().header("param1", "value1");
method.send( .... );

If you don't do this, doesn't work. I don't use resty-gwt with annotations, I had a lot of problems....
Re: [resty-gwt] Custom Header Problem kristian 11/3/11 7:53 AM
if I look at the code then

Map<String,String> headers = new HashMap<>();
headers.put("param1", "value1");
Method method = new Resource(url, headers).get();
method.send(...);

should do the same as in your examples. if only your TRICK works
please file a bug sowe can track it down.

regards, Kristian

Re: [resty-gwt] Custom Header Problem Zahir Hamroune 11/3/11 8:08 AM
Yep it works with method.send();
how can i create a bug?
thanks

2011/11/3 kristian <m.kri...@web.de>
Re: [resty-gwt] Custom Header Problem Demostenes1509 11/3/11 8:14 AM
You're welcome. I'm very happy you could make it work !

         Bye !
Re: [resty-gwt] Custom Header Problem kristian 11/3/11 8:25 AM
On Thu, Nov 3, 2011 at 8:38 PM, Zahir Hamroune <hamro...@sfeir.com> wrote:
> how can i create a bug?

https://github.com/chirino/resty-gwt/issues

thanx, Kristian