You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by "Menke, John" <Jo...@acs-inc.com> on 2003/09/17 21:05:43 UTC

Forwarding to existing servlet from Struts??

I need to forward from a struts action to a servlet.  How can this be done?

-john

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


Re: Forwarding to existing servlet from Struts??

Posted by Christian Bollmeyer <ja...@christianbollmeyer.de>.
Am Mittwoch, 17. September 2003 21:05 schrieb Menke, John:

Basically, forwards are handled (Struts or not) internally in the
server by javax.servlet.RequestDispatcher. So forwards are
generally possible only within the same machine | VM. This
said, you should declare your Servlet as usual in web.xml,
assigning it a path it can be invoked by first (web.xml).
In your Action mapping you then may either specify the
servlet path that you chose for web.xml (/YourServlet,
for example) or wrap this path by setting up another
Action of the 'forward' type that does little more than
calling up the web.xml servlet path, with the benefit
that you may use the traditional .do extension rule
for your links. among other benefits if you decide
to to replace ForwardAction with a custom one
later.

But as all the  gurus seem to be assembled here
who seemingly tend to answer just 'yes' sometimes
instead of nothing at all, but still don't refrain from
citing the Smart Question FAQ on other occasions
(admitting that's about questions, not answers, but
still): Would one of you care bothering to explain
why the generic ForwardAction always
seems to generate a session even though all
relevant JSPs state 'session=false' and no
previous session existed? So, for example, if
I say '/main.do', everything from there runs in
a session, even though it's just a dumb for-
ward to /main.jsp with session="false", and if
I invoke that page directly, it just works as
expected (without session info)? 

-- Chris (SCPJ2)

who sometimes still wishes people had just asked
their silly questions before just nodding 'No Problem'
and then going on to code some unusable garbage
just in fear to lose their faces.

> I need to forward from a struts action to a servlet.  How can this be
> done?
>
> -john
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: struts-user-help@jakarta.apache.org


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


RE: Forwarding to existing servlet from Struts??

Posted by Andrew Hill <an...@gridnode.com>.
say what?

The input? ummmm....

-----Original Message-----
From: Carey Nation [mailto:careynation@adelphia.net]
Sent: Thursday, 18 September 2003 03:18
To: Struts Users Mailing List
Subject: Re: Forwarding to existing servlet from Struts??


> I need to forward from a struts action to a servlet.  How can this be
done?

I would think just make the input for the forward the url for the servlet...


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


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


Re: Forwarding to existing servlet from Struts??

Posted by Carey Nation <ca...@adelphia.net>.
> I need to forward from a struts action to a servlet.  How can this be
done?

I would think just make the input for the forward the url for the servlet...


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


RE: Forwarding to existing servlet from Struts??

Posted by Andrew Hill <an...@gridnode.com>.
Have you tried using an ActionForward? (duh)

-----Original Message-----
From: Menke, John [mailto:John.Menke@acs-inc.com]
Sent: Thursday, 18 September 2003 03:06
To: Struts (E-mail)
Subject: Forwarding to existing servlet from Struts??


I need to forward from a struts action to a servlet.  How can this be done?

-john

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


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