Re: manipulating the http requests.....

J2EE Professional <[email protected]> Thu, 12 Jan 2006 06:19:26 +0000 (GMT)
Newsgroups gmane.comp.java.advanced-servlets
Message-ID <[email protected]>
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 write=
s:

> Hi Guys,
>=20
> 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.
>=20
> 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....
>=20
> 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:=20

Announcements should go to: [email protected]
To Post a message, send it to: [email protected]
To Unsubscribe, send a blank message to: advanced-servlets-unsubscribe@eGro=
ups.com=20
Yahoo! Groups Links









=09=09
---------------------------------
Yahoo! Photos =96 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:=20
<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: advanced-servlets-unsubscribe@eGro=
ups.com=20
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/
=20