Re: Forwarding to existing servlet from Struts??
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]
RE: Forwarding to existing servlet from Struts??
That worked perfectly thanks :) -Original Message- From: Andrew Hill [mailto:[EMAIL PROTECTED] Sent: Wednesday, September 17, 2003 3:27 PM To: Struts Users Mailing List Subject: RE: Forwarding to existing servlet from Struts?? Umm.. if its in a different webapp the Im not sure what you need to do (& it would need to be redirecting in that case and I think you have to set the 'absolute' property??? hmmm), but for a servlet in the same webapp its not a problem, just define the forward to the appropriate path (or more specifically to the path you mapped for that servlet in web.xml) just like you would for a jsp (which is in fact really a servlet in disguise!) -Original Message- From: Menke, John [mailto:[EMAIL PROTECTED] Sent: Thursday, 18 September 2003 03:19 To: 'Struts Users Mailing List' Subject: RE: Forwarding to existing servlet from Struts?? that would be a good start I guess. :) -Original Message- From: Andrew Hill [mailto:[EMAIL PROTECTED] Sent: Wednesday, September 17, 2003 3:11 PM To: Struts Users Mailing List Subject: RE: Forwarding to existing servlet from Struts?? Have you tried using an ActionForward? (duh) -Original Message- From: Menke, John [mailto:[EMAIL PROTECTED] 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: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - 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] - 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]
RE: Forwarding to existing servlet from Struts??
say what? The input? u -Original Message- From: Carey Nation [mailto:[EMAIL PROTECTED] 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: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
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: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Forwarding to existing servlet from Struts??
Umm.. if its in a different webapp the Im not sure what you need to do (& it would need to be redirecting in that case and I think you have to set the 'absolute' property??? hmmm), but for a servlet in the same webapp its not a problem, just define the forward to the appropriate path (or more specifically to the path you mapped for that servlet in web.xml) just like you would for a jsp (which is in fact really a servlet in disguise!) -Original Message- From: Menke, John [mailto:[EMAIL PROTECTED] Sent: Thursday, 18 September 2003 03:19 To: 'Struts Users Mailing List' Subject: RE: Forwarding to existing servlet from Struts?? that would be a good start I guess. :) -Original Message- From: Andrew Hill [mailto:[EMAIL PROTECTED] Sent: Wednesday, September 17, 2003 3:11 PM To: Struts Users Mailing List Subject: RE: Forwarding to existing servlet from Struts?? Have you tried using an ActionForward? (duh) -Original Message- From: Menke, John [mailto:[EMAIL PROTECTED] 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: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - 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] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Forwarding to existing servlet from Struts??
that would be a good start I guess. :) -Original Message- From: Andrew Hill [mailto:[EMAIL PROTECTED] Sent: Wednesday, September 17, 2003 3:11 PM To: Struts Users Mailing List Subject: RE: Forwarding to existing servlet from Struts?? Have you tried using an ActionForward? (duh) -Original Message- From: Menke, John [mailto:[EMAIL PROTECTED] 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: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - 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]
RE: Forwarding to existing servlet from Struts??
Have you tried using an ActionForward? (duh) -Original Message- From: Menke, John [mailto:[EMAIL PROTECTED] 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: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
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: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]