-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Darryl,

Darryl Pentz wrote:
> I also just encountered the 'crosscontext' attribute in the
> <context.../> block and was wondering whether that could serve any
> purpose.

If you don't mind issuing another request (not a new HTTP connection,
just another request dispatched within Tomcat), you can use "cross
context" like this. The docs for that option say:

"Set to true if you want calls within this application to
ServletContext.getContext() to successfully return a request dispatcher
for other web applications running on this virtual host. Set to false
(the default) in security conscious environments, to make getContext()
always return null."

That means that if you have webappA deployed to /webappA and webappB
deployed to /webappB in the same container, then you should be able to
do this in a servlet in webappA:

ServletContext application = getServletContext();
ServletContext webappB = application.getContext("/webappB/service/to/call");
RequestDispatcher dispatcher =
webappB.getRequestDispatcher("/service/to/call");

// Invoke webapp B's service
dispatcher.forward(request, response);

- -----

Now, if this works, you have some options. Obviously, you don't simply
want to turn processing completely over to webappB's service. In that
case, you should be able to create your own HttpServletRequest and
HttpServletResponse objects (or wrap the existing ones already available
from the current invocation) and use /those/ with the dispatcher. Than,
you can pick and choose what happens to the response.

- -chris
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iEYEARECAAYFAkjvsfAACgkQ9CaO5/Lv0PD4zgCgvMqDxgAl+AkI7Do6LeHTSTct
O/8An0po+B4IBbHgSeNZppucLa/IUP8R
=EcZu
-----END PGP SIGNATURE-----

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

Reply via email to