You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Sony Thomas <so...@genialgenetics.com> on 2006/04/19 19:01:55 UTC

************* forwarding to a servlet from my jsp ***********

Hi,

I have a struts application. From one of the jsp pages I have to forward 
to a servlet when I submit the jsp. Can anyone help me to  find a 
solution for this problem. I have two buttons in my JSP. When I click 
one of the buttons it should go to the action class. When I click the 
other button it should forward to a servlet. I have a javascript 
function. Inside javascript function I am checking which of the button 
is clicked. Can anyone tell me from inside javascript function how is it 
possible to forward to the servlet.

Thanks in advance and this is bit urgent please help.....

sony

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: ************* forwarding to a servlet from my jsp ***********

Posted by Ashish Kulkarni <as...@gmail.com>.
Hi
You have use following code in jsp

RequestDispatcher dispatcher = request.getRequestDispatcher(servlet path);
    dispatcher.forward(request, response);



On 4/19/06, Sony Thomas <so...@genialgenetics.com> wrote:
>
> Hi,
>
> I have a struts application. From one of the jsp pages I have to forward
> to a servlet when I submit the jsp. Can anyone help me to  find a
> solution for this problem. I have two buttons in my JSP. When I click
> one of the buttons it should go to the action class. When I click the
> other button it should forward to a servlet. I have a javascript
> function. Inside javascript function I am checking which of the button
> is clicked. Can anyone tell me from inside javascript function how is it
> possible to forward to the servlet.
>
> Thanks in advance and this is bit urgent please help.....
>
> sony
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>