Re: Server side forward across different webapps?

2006-12-07 Thread IT Desk

Yes, you can do this.
You have to get the ServletContext of the other web app.
Use your current servletContext and call getContext() with the uripath
of the other web app.  Use the returned context to get a 
RequestDispatcher.  Use the RequestDispatcher as you would normally.


See the servlet api as needed.

Stanley Yue wrote:

Hi all:

I have two webapps running in the same tomcat process.

I want to have one webapps perform a server-side forward to a servlet in 
the

second webapps?

Is this possible?
If not, what are some of the workarounds?

Thanks,

Stanley



-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: Server side forward across different webapps?

2006-12-07 Thread Caldarale, Charles R
 From: IT Desk [mailto:[EMAIL PROTECTED] 
 Subject: Re: Server side forward across different webapps?
 
 You have to get the ServletContext of the other web app.
 Use your current servletContext and call getContext() with the uripath
 of the other web app.

Note that you must set the crossContext attribute to true in your
Context element for this to work.  See the following for more details:
http://tomcat.apache.org/tomcat-5.5-doc/config/context.html

 - Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY
MATERIAL and is thus for use only by the intended recipient. If you
received this in error, please contact the sender and delete the e-mail
and its attachments from all computers.

-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: Server side forward across different webapps?

2006-12-07 Thread Michael Hencin
Along this line of thought, I have one webapp. webApp1 and a second, I
supply called webApp2. Is there a way, that I can lookup the context of
webapp2, knowing that the customer may change the name of that webapp2 at
deployment time? I cant rely on the webapp2 name, since a user could change
that. Also the installation of webapp2 is optional.

I have in webapp1 a link to webapp2. Right now I create an environment
variable in the webapp1 contextfile, that lists the URI for webapp2. This
env-variable is then used as the link in webapp1.

It would be very nice to take this step out, if there was a consistent way
to know the context of webapp2 without requiring user input and still work
if the users changed the name of webapp2 at deploy time. Maybe some global
resource variable I set with webapp2 that's transparent to the user?

Mike

-Original Message-
From: Caldarale, Charles R [mailto:[EMAIL PROTECTED] 
Sent: Thursday, December 07, 2006 1:03 PM
To: Tomcat Users List
Subject: RE: Server side forward across different webapps?

 From: IT Desk [mailto:[EMAIL PROTECTED]
 Subject: Re: Server side forward across different webapps?
 
 You have to get the ServletContext of the other web app.
 Use your current servletContext and call getContext() with the uripath 
 of the other web app.

Note that you must set the crossContext attribute to true in your Context
element for this to work.  See the following for more details:
http://tomcat.apache.org/tomcat-5.5-doc/config/context.html

 - Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY
MATERIAL and is thus for use only by the intended recipient. If you received
this in error, please contact the sender and delete the e-mail and its
attachments from all computers.

-
To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe,
e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]