cxf-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Barry Fitzgerald" <barfitzger...@gmail.com>
Subject JAX-RS @HeaderParam support
Date Mon, 03 Mar 2008 12:07:14 GMT
Hi all,

I was thinking of implementing header parameter support. But I just wanted
to check one thing. What do people think should happen in the case of
headers being specified multiple times e.g.

If the below method is invoked with the header for foo set twice. E.g.
foo=bar and foo=baz

 public Response getUser(@UriParam("id") String id,  @HeaderParam("foo")
String header) throws Exception {
        System.out.println("Header is:  " + header);
        ....
    }

The spec says:

*@HeaderParam The class of the annotated parameter MUST have a constructor
that accepts a single
String argument, or a static method named valueOf that accepts a single
String argument. Other
types may be supported using a HeaderProvider as described in section 3.2.

*This seems to suggest we should not be annotating lists etc. to handle
values specified multiple times. I think we should just use the first one
found or maybe raise this as an issue with the spec.

Let me know what you think,

Barry

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message