users@jersey.java.net

[Jersey] Re: Response redirect/forward

From: Jose Antonio Illescas Del Olmo <jantonio.illescas_at_rbcdexia-is.es>
Date: Fri, 05 Aug 2011 12:48:54 +0200

Actually I have own REST framework (started at late 2002 after read REST
and the real world <http://www.xml.com/pub/a/ws/2002/02/20/rest.html> by
Paul Prescod) and I will trying migrate to JAX-RS (jersey),

    Own REST framework use servlet filters to work, and this filters,
using redirect/forward methods on html/browser navigation

I love the JAX-RS annotation approach, is very, VERY, simple and usefull
on computer-to-computer interaction

    But I see the lack of standar on JAX-RS for "custom Controllers
(MVC)" for user interaction on web applications.


Thank you Pavel

   PD: I will try to remove "old forwards" to another approach on JAX-RS...


On 05/08/2011 11:32, Pavel Bucek wrote:
> Why would you want to do that?
>
> And to answer - no, JAX-RS does not have anything like "forward", BUT
> you can easily implement it. You can call another service (using
> jersey client for example) and return its result as a response to your
> original request, so "browser" (original client) would NOT be aware of
> internal forward.
>
> I have to mention that returning "seeOther" (http status 303 or maybe
> 301) would be my preferred solution.
>
> Regards,
> Pavel
>
> On 8/5/11 10:55 AM, Jose Antonio Illescas Del Olmo wrote:
>> Response class define a "seeOther" method for use in redirect-after-POST
>>
>> I see this method as "sendRedirect" of Servlet API
>>
>> But I not see any JAX-RS alternative to "forward".
>>
>> I can "forward" (as Sevlet API does) with JAX-RS?
>>
>> Thank you
>>
>
>