RE: how to forward from one action servlet to another?
Nope the thread after invoking perform() will then decide what to do next. Since you are already making its decision, it won't complain and will die gracefully. An other way to do it is already pointed out by other people. In your struts-config.xml file map the forward to a different servlet One thing you might want to consider ... If you are using a web application (war file or ear file) you have to declare all your servlets in the web.xml file. cheers, Amar.. -Original Message- From: Rajan Gupta [mailto:[EMAIL PROTECTED]] Sent: Thursday, May 10, 2001 3:45 PM To: [EMAIL PROTECTED] Subject: RE: how to forward from one action servlet to another? Will this not keep the thread of ActionServlet which invoked perform() method hanging? --- "Nanduri, Amarnath" <[EMAIL PROTECTED]> wrote: > If you are using just Struts, then you have only one servlet, the > ActionServlet. > If you are using struts in conjunction with some other servlets, then in > your action class do this... > > public class XYZAction extends Action > { > > public ActionForward perform(mapping, form, request, response) > { > > request.setAttribute("form", form) ; > > > servlet.getServletConfig().getServletContext().getRequestDispacher("path > to the other servlet").forward(request,response) ; > > } > > } > > -Original Message- > From: Alex Colic [mailto:[EMAIL PROTECTED]] > Sent: Thursday, May 10, 2001 2:29 PM > To: Struts > Subject: how to forward from one action servlet to another? > > > Hi, > > how do you forward from one action servlet to another? I have a form > that > gets submitted to a servlet that I may depending on a value pass it off > to > another servlet to process. > > Any help is appreciated. > > Alex > > ext. 104 > Fax: 1-905-777-0132 __ Do You Yahoo!? Yahoo! Auctions - buy the things you want at great prices http://auctions.yahoo.com/
RE: how to forward from one action servlet to another?
Will this not keep the thread of ActionServlet which invoked perform() method hanging? --- "Nanduri, Amarnath" <[EMAIL PROTECTED]> wrote: > If you are using just Struts, then you have only one servlet, the > ActionServlet. > If you are using struts in conjunction with some other servlets, then in > your action class do this... > > public class XYZAction extends Action > { > > public ActionForward perform(mapping, form, request, response) > { > > request.setAttribute("form", form) ; > > > servlet.getServletConfig().getServletContext().getRequestDispacher("path > to the other servlet").forward(request,response) ; > > } > > } > > -Original Message- > From: Alex Colic [mailto:[EMAIL PROTECTED]] > Sent: Thursday, May 10, 2001 2:29 PM > To: Struts > Subject: how to forward from one action servlet to another? > > > Hi, > > how do you forward from one action servlet to another? I have a form > that > gets submitted to a servlet that I may depending on a value pass it off > to > another servlet to process. > > Any help is appreciated. > > Alex > > ext. 104 > Fax: 1-905-777-0132 __ Do You Yahoo!? Yahoo! Auctions - buy the things you want at great prices http://auctions.yahoo.com/
Re: how to forward from one action servlet to another?
Alex, if I understand you correctly, you can set up the forwarding in your struts-config.xml to point to the next action path: eg hth, Dave "Alex Colic" <[EMAIL PROTECTED]> on 05/10/2001 02:29:28 PM Please respond to [EMAIL PROTECTED] To: "Struts" <[EMAIL PROTECTED]> cc:(bcc: David Hay/Lex/Lexmark) Subject: how to forward from one action servlet to another? Hi, how do you forward from one action servlet to another? I have a form that gets submitted to a servlet that I may depending on a value pass it off to another servlet to process. Any help is appreciated. Alex ext. 104 Fax: 1-905-777-0132
RE: how to forward from one action servlet to another?
If you are using just Struts, then you have only one servlet, the ActionServlet. If you are using struts in conjunction with some other servlets, then in your action class do this... public class XYZAction extends Action { public ActionForward perform(mapping, form, request, response) { request.setAttribute("form", form) ; servlet.getServletConfig().getServletContext().getRequestDispacher("path to the other servlet").forward(request,response) ; } } -Original Message- From: Alex Colic [mailto:[EMAIL PROTECTED]] Sent: Thursday, May 10, 2001 2:29 PM To: Struts Subject: how to forward from one action servlet to another? Hi, how do you forward from one action servlet to another? I have a form that gets submitted to a servlet that I may depending on a value pass it off to another servlet to process. Any help is appreciated. Alex ext. 104 Fax: 1-905-777-0132
Re: how to forward from one action servlet to another?
You could either define a forward for this action in struts-config.xml, or construct a new ActionForward on the fly. Alex Colic wrote: > Hi, > > how do you forward from one action servlet to another? I have a form that > gets submitted to a servlet that I may depending on a value pass it off to > another servlet to process. > > Any help is appreciated. > > Alex > > ext. 104 > Fax: 1-905-777-0132
how to forward from one action servlet to another?
Hi, how do you forward from one action servlet to another? I have a form that gets submitted to a servlet that I may depending on a value pass it off to another servlet to process. Any help is appreciated. Alex ext. 104 Fax: 1-905-777-0132