users@jersey.java.net

Re: [Jersey] Forward to Servlet

From: Franz Wong <franzwong_at_gmail.com>
Date: Fri, 30 Jul 2010 16:17:00 +0800

Thanks. I have used the first approach. Creating a new class based on the
JSPTemplateProcessor and modify the "resolve" method. In the "resolve"
method, I just return the parameter as the resolved path.

A little bit offtopic, forwarding to struts action requires modification of
web.xml. The following is needed to add to struts filter.

<dispatcher>REQUEST</dispatcher>
<dispatcher>FORWARD</dispatcher>

Franz

On Thu, Jul 29, 2010 at 9:34 PM, Paul Sandoz <Paul.Sandoz_at_oracle.com> wrote:

> Hi Franz,
>
> It is not currently supported by Jersey.
>
> If you need to pass some state it might be possible to reuse Viewable and
> write your own ViewProcessor.
>
> See the code in JSPTemplateProcessor, from which you can copy:
>
>
> http://fisheye4.atlassian.com/browse/jersey/trunk/jersey/jersey-server/src/main/java/com/sun/jersey/server/impl/container/servlet/JSPTemplateProcessor.java?r=HEAD
>
> Alternatively it should be possible to write your own Forward class and
> MessageBodyWriter to process it which performs a forward using a
> RequestDispatcher.
>
> Paul.
>
>
> On Jul 29, 2010, at 5:55 AM, Franz Wong wrote:
>
> Hi group,
>>
>> I have a restful service and I would like to forward it to a Servlet. For
>> plain JSP, I know I can return a Viewable. How about Servlet?
>>
>> (Actually what I really want to do is forwarding the service to a "Struts
>> taglib" used JSP.)
>>
>> Thanks,
>> Franz
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_jersey.dev.java.net
> For additional commands, e-mail: users-help_at_jersey.dev.java.net
>
>