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: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to