[
https://issues.apache.org/jira/browse/CXF-2471?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12787467#action_12787467
]
Sergey Beryozkin commented on CXF-2471:
---------------------------------------
See
http://svn.apache.org/repos/asf/cxf/trunk/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/CustomAtomFeedProvider.java
and the output which is produced :
HTTP/1.1 200 OK
Content-Type: application/atom+xml
Date: Tue, 08 Dec 2009 13:50:13 GMT
Content-Length: 508
Server: Jetty(6.1.21)
<?xml version="1.0" encoding="ISO-8859-1"?><feed
xmlns="http://www.w3.org/2005/Atom"
xmlns:xml="http://www.w3.org/XML/1998/namespace"
xml:base="http://localhost:9081/bookstore/bookstore4/books/feed"><title
type="text">Collection of
Books</title><id>http://www.books.com</id><author><name>BookStore Management
Company</name></author><entry><title type="text">CXF in
Action</title><id>123</id><content type="application/xml"><Book
xmlns=""><id>123</id><name>CXF in Action</name></Book></content></entry></feed>
Note that if you set a formattedOutput property to true then Abdera will itself
add an xml directive.
See also an atomservice4 endpoint in
http://svn.apache.org/repos/asf/cxf/trunk/systests/jaxrs/src/test/resources/jaxrs_atom/WEB-INF/beans.xml
and
http://svn.apache.org/repos/asf/cxf/trunk/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/AtomBookStore.java
(private Feed doGetBookAsFeed(@Context UriInfo uParam))
what is different in your case ?
> The HttpServletResponse statuses is lost after is set in a service
> implementation (where the response is injected through @Context).
> ------------------------------------------------------------------------------------------------------------------------------------
>
> Key: CXF-2471
> URL: https://issues.apache.org/jira/browse/CXF-2471
> Project: CXF
> Issue Type: Bug
> Components: JAX-RS
> Affects Versions: 2.2.4
> Reporter: Vincenzo Vitale
> Assignee: Sergey Beryozkin
> Fix For: 2.2.5, 2.3
>
>
> After injecting the the HttpServletResponse with the @Context annotation:
> @POST
> @Path("/login")
> public Feed login(@FormParam("username") String username,
> @FormParam("password") String password,
> @Context HttpServletResponse httpServletResponse)
> and than setting a status code (for example 401 if the user is not
> authorized), the status code get lost.
> See here for workarounds and more detials:
> http://www.nabble.com/Setting-the-status-code-in-the-injected-(via-the-jax-...@context)--HttpServletResponse-td25883621.html
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.