RE: Digest Number 382
"Raghavendra Samant" <[email protected]> Thu, 12 Jan 2006 22:30:20 +0530
| Newsgroups | gmane.comp.java.advanced-servlets |
|---|---|
| Message-ID | <1AFAE43F639A2448A1F85A2F98AECFEA0D06BF@BLRKECMSG04.ad.infosys.com> |
Try using a action variable in the URL request of the requestdispatcher or set a variable in the session and then use the variable in teh invoked servlet's service () method hope this helps Samant ________________________________ From: [email protected] [mailto:[email protected]] Sent: Thu 1/12/2006 7:51 AM To: [email protected] Subject: [advanced-servlets] Digest Number 382 There is 1 message in this issue. Topics in this digest: 1. Re: manipulating the http requests..... From: J2EE Professional <[email protected]> ________________________________________________________________________ ________________________________________________________________________ Message: 1 Date: Thu, 12 Jan 2006 06:19:26 +0000 (GMT) From: J2EE Professional <[email protected]> Subject: Re: manipulating the http requests..... how do we call a method of a servlet using RequestDispatcher. With request dispatcher we can call a second servlet from one servlet, but if i want to call a foo() method inside the second servlet, how do i call it (even after using RequestDispatcher)... thats my question Nic Ferrier <[email protected]> wrote: J2EE Professional writes: > Hi Guys, > > Right now i have a servlet which is doing some processing. This > servlet is the main servlet of the application or the entry point > to my web application. Now what i want to do is that i want to > change the entry point to my web application from this mainServlet > to a new servlet (say newServlet.java). So now, the request should > come to this new component and then should be delegated to the > mainServlet....also the response should be relayed thorugh > newServlet only... How can i acheive this. > > One way is that i can modify the web.xml and for the URL pattern > of mainServlet i will invoke newServlet instead. But then in this > case how do i invoke the mainServlet from newServlet then....Or > else i could have a filter before the mainServlet. Actually, this > newServlet need not be a servlet also...the requirement dosent ask > this to be a servlet. it could be a java class also...what the > requirement says is that that the entry point should be > changed...and the response should also be changed...but i dont c > any other way of chaging the entry point...since its a web > application it has to be a servlet or filter.... > > Also, if i have newServlet, how do i invoke a method in > mainServlet...say there is a foo() in mainServlet, how do i invoke > it from newServlet... Why won't a RequestDispatcher work? Nic Before posting a question, try to find your answer here: Announcements should go to: [email protected] To Post a message, send it to: [email protected] To Unsubscribe, send a blank message to: [email protected] Yahoo! Groups Links --------------------------------- Yahoo! Photos - NEW, now offering a quality print service from just 8p a photo. [Non-text portions of this message have been removed] ________________________________________________________________________ ________________________________________________________________________ Before posting a question, try to find your answer here: <http://www.egroups.com/links/advanced-servlets> Announcements should go to: [email protected] To Post a message, send it to: [email protected] To Unsubscribe, send a blank message to: [email protected] ------------------------------------------------------------------------ Yahoo! Groups Links ------------------------------------------------------------------------ ---------- **************** CAUTION - Disclaimer ***************** This e-mail contains PRIVILEGED AND CONFIDENTIAL INFORMATION intended solely for the use of the addressee(s). If you are not the intended recipient, please notify the sender by e-mail and delete the original message. Further, you are not to copy, disclose, or distribute this e-mail or its contents to any other person and any such actions are unlawful. This e-mail may contain viruses. Infosys has taken every reasonable precaution to minimize this risk, but is not liable for any damage you may sustain as a result of any virus in this e-mail. You should carry out your own virus checks before opening the e-mail or attachment. Infosys reserves the right to monitor and review the content of all messages sent to or from this e-mail address. Messages sent to or from this e-mail address may be stored on the Infosys e-mail system. ***INFOSYS******** End of Disclaimer ********INFOSYS*** [Non-text portions of this message have been removed] Before posting a question, try to find your answer here: <http://www.egroups.com/links/advanced-servlets> Announcements should go to: [email protected] To Post a message, send it to: [email protected] To Unsubscribe, send a blank message to: [email protected] Yahoo! Groups Links <*> To visit your group on the web, go to: http://groups.yahoo.com/group/advanced-servlets/ <*> To unsubscribe from this group, send an email to: [email protected] <*> Your use of Yahoo! Groups is subject to: http://docs.yahoo.com/info/terms/