|
From: Bill B. <bb...@re...> - 2008-10-28 23:58:00
|
Bug. Didn't know that was the behavior.
Michael Brackx wrote:
> I get a NullPointerException if setting a header to null with the
> ResponseBuilder
> Response.ok().header("header", null).build;
>
> The javadoc for ResponseBuilder.header(String name,Object value)
> states "If value is null then all current headers of the same name
> will be removed."
> So I removed my if's and tried the fluent style for adding multiple
> (optional) headers assuming null's are ok.
> Response.ok().header("header1", value1).header("header2", value2).build;
>
> stacktrace:
> java.lang.NullPointerException
> at org.jboss.resteasy.plugins.server.servlet.HttpServletResponseHeaders.addResponseHeader(HttpServletResponseHeaders.java:56)
> at org.jboss.resteasy.plugins.server.servlet.HttpServletResponseHeaders.add(HttpServletResponseHeaders.java:51)
> at org.jboss.resteasy.plugins.server.servlet.HttpServletResponseHeaders.putAll(HttpServletResponseHeaders.java:120)
> at org.jboss.resteasy.core.SynchronousDispatcher.outputHeaders(SynchronousDispatcher.java:456)
> at org.jboss.resteasy.core.SynchronousDispatcher.writeJaxrsResponse(SynchronousDispatcher.java:430)
> at org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:357)
> at org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:182)
> at org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.service(HttpServletDispatcher.java:90)
> at org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.service(HttpServletDispatcher.java:66)
> at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
> ...
>
>
> Michael Brackx
>
> -------------------------------------------------------------------------
> This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
> Build the coolest Linux based applications with Moblin SDK & win great prizes
> Grand prize is a trip for two to an Open Source event anywhere in the world
> http://moblin-contest.org/redirect.php?banner_id=100&url=/
> _______________________________________________
> Resteasy-developers mailing list
> Res...@li...
> https://lists.sourceforge.net/lists/listinfo/resteasy-developers
--
Bill Burke
JBoss, a division of Red Hat
http://bill.burkecentral.com
|