users@jersey.java.net

Re: [Jersey] URL redirect/Forward in Jersey

From: Anil Kumar Veeramalli <anil.v_at_frescoinformatics.com>
Date: Wed, 25 Nov 2009 17:56:38 +0530

Thanks Paul.

return new Viewable("/success", null); is working for me.

Thanks,
Anil
Paul Sandoz wrote:
>
> On Nov 25, 2009, at 12:03 PM, Paul Sandoz wrote:
>
>>
>> On Nov 25, 2009, at 11:43 AM, Anil Kumar Veeramalli wrote:
>>
>>> Hi,
>>>
>>> I am trying to forward/redirect result.jsp page from my code. I am
>>> not able to find correct API.
>>>
>>> Please help me out on this.
>>>
>>> I tried using HttpResponseContext,HttpServerletContext...
>>>
>>
>> If you want to perform an "internal" forward you can return an
>> instance of Viewable:
>>
>> https://jersey.dev.java.net/nonav/apidocs/latest/jersey/com/sun/jersey/api/view/Viewable.html
>>
>>
>> However be careful. If you are using the Jersey ServletContainer as a
>> servlet and declare a url pattern of "/*" it will not work. This is
>> because the Jersey servlet will swallow all requests. In such a case
>> you need to use the Jersey ServletContainer as a servlet filter.
>>
>
> Clarification: such a restriction as described above is only valid for
> JSPs. If you are using another template technology and a
> TemplateProcessor, such as one that supports Freemarker, there is no
> such a restriction.
>
> Paul.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_jersey.dev.java.net
> For additional commands, e-mail: users-help_at_jersey.dev.java.net
>
>