Hi

Hi,

I'm integrating a ResponseHandler with common code modyfing the final
response. It's than added through spring to the jaxrs:server section as a
provider.

The service is this:
   @POST
   @Path("/login")
   @Produces("text/html")
   public void login(@FormParam("username") String username,
           @FormParam("password") String password,
           @FormParam("rememberMe") boolean rememberMe,
           @FormParam("redirect") String redirect)


and than in spring:

<bean id="atomWfeAuthenticationWebService"
class="com.tomtom.buenosaires.ws.wfe.authentication.impl.AtomWfeAuthenticationRestWebService">
<property name="wfeAuthenticationService" ref="wfeAuthenticationService" />
</bean>

<jaxrs:server id="atomWfeAuthenticationRestWebService"
address="/wfe/authentication">
<jaxrs:serviceBeans>
<ref bean="atomWfeAuthenticationWebService" />
</jaxrs:serviceBeans>
<jaxrs:providers>
<ref bean="atomFeedProvider" />
<ref bean="cacheDisabledFilter" />
</jaxrs:providers>
</jaxrs:server>


the atom feed provider is there in case the service definition will change
and a proper atom feed will be returned. I guess the problem is related with
nothing being returned.

According to the JAX-RS spec, it has to be just 204 that has to be returned...I'll need to have a look and check if letting custom response handlers to override a default Response would make sense even for void methods...What exactly would you like to be returned on the wire for a POST-handling method returning 'void' ?


Is there a way to fix that or are we forced to always return something
(which maybe probably also make sense).

Perhaps you can use HttpServletResponse directly ? Another option is to create a custom out CXF interceptor (instead of ResponseHandler), it will run before JAXRSOutInterceptor is invoked...Or may be you can just return a Response, instead of 'void' ?


cheers, Sergey



thanks,
V.


Reply via email to