You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by David Leangen <wi...@leangen.net> on 2008/09/19 05:12:08 UTC

Forwarding to a servlet

Hi!

What's a clean way to forward a request to another existent non-Wicket
servlet?

I have a wicket page that handles user input, then the input should be
processed by the existing servlet. 

Rather than redirecting to an external URL, I thought it would be nice
to just forward the request to the other servlet. However, I'm worried
that this will leave Wicket is some strange state...


Thanks!
David




---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: Forwarding to a servlet

Posted by David Leangen <wi...@leangen.net>.
> >> I think you could just use response.sendRedirect() and
> >> request.forward() , rest of the code should still be
> >> processed.


This seemed to work just fine:

  RequestCycle.get().setRequestTarget( redirectTarget );

However, I'm running into a problem... not sure if it's related or not,
so I'll start a new thread.


=David.Leangen



---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: Forwarding to a servlet

Posted by Nino Saturnino Martinez Vazquez Wael <ni...@jayway.dk>.
No problem.. Happy to help.

David Leangen wrote:
>> Hi David
>>     
>
> Hi Nino!
>
> [Oops. Didn't see your message until now...]
>
>   
>> I think you could just use response.sendRedirect() and
>> request.forward() , rest of the code should still be
>> processed.
>>     
>
> Ok, good to know.
>
>
>   
>> But are you expecting the user to return from the servlet?
>>     
>
> Still not sure what I want yet... in the process of figuring that out.
> Hopefully will know when I get back in front of my machine tomorrow...
>
> Thanks for the reply.
>
> David
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>   

-- 
-Wicket for love

Nino Martinez Wael
Java Specialist @ Jayway DK
http://www.jayway.dk
+45 2936 7684


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


RE: Forwarding to a servlet

Posted by David Leangen <wi...@leangen.net>.
> Hi David

Hi Nino!

[Oops. Didn't see your message until now...]

> I think you could just use response.sendRedirect() and
> request.forward() , rest of the code should still be
> processed.

Ok, good to know.


> But are you expecting the user to return from the servlet?

Still not sure what I want yet... in the process of figuring that out.
Hopefully will know when I get back in front of my machine tomorrow...

Thanks for the reply.

David


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: Forwarding to a servlet

Posted by Nino Saturnino Martinez Vazquez Wael <ni...@jayway.dk>.
Hi David

I think you could just use

response.sendRedirect() and request.forward() , rest of the code should 
still be processed.. But are you expecting the user to return from the 
servlet?

David Leangen wrote:
> Hi!
>
> What's a clean way to forward a request to another existent non-Wicket
> servlet?
>
> I have a wicket page that handles user input, then the input should be
> processed by the existing servlet. 
>
> Rather than redirecting to an external URL, I thought it would be nice
> to just forward the request to the other servlet. However, I'm worried
> that this will leave Wicket is some strange state...
>
>
> Thanks!
> David
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>   

-- 
-Wicket for love

Nino Martinez Wael
Java Specialist @ Jayway DK
http://www.jayway.dk
+45 2936 7684


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org