Yes that is exactly what you should use, but as you can read from that last sentence in the specification (In a security conscious environment, the servlet container may return null for a given URL.) it might be null.
In Tomcat, the crossContext attribute controls whether this is authorized or not. In other servers it might be controlled elsewhere.
Another problem is if you intend to use RequestWrapper and ResponseWrapper objects by using cross-context calls. This is where I have seen the most problem in servers such as WebLogic. Programmaticaly, according to the spec this should be possible, but the spec doesn't insist on it so a lot of servlet containers didn't build test cases for this.
What this would allow is something like this :
HttpServletRequestWrapper requestWrapper = new MyRequestWrapperImpl(request);
HttpServletResponseWrapper responseWrapper = new MyResponseWrapperImpl(response);
ServletContext dispatchContext = ServletContext.getContext(urlToPortletApp)
RequestDispatcher requestDispatcher = dispatchContext.getRequestDispatcher(urlToServlet);
requestDispatcher.include(requestWrapper, responseWrapper);
As I said, the above code works flawlessly in all versions of Tomcat since version 4. In other app servers I've seen a lot of strange behavior. Normally Tomcat should be the reference implementation for this type of usage, but well, it's such a specific usage that it gets overlooked a lot.
I believe (haven't had time to look into it) that Pluto must use something similar to this to do dispatching, although I'm not entirely sure.
Regards, Serge Huber.
At 03:45 PM 10/7/2003 +0200, you wrote:
On Tue, 7 Oct 2003, Serge Huber wrote:
| | Hi Glenn, | | Actually I do the same thing in my portal implementation for my software, I | use the cross context feature of Jahia. So far I've managed to find similar | features in the following application servers : | | - WebLogic (although VERY buggy) | - Orion Server (works) | - Tomcat (the best, Craig and Remy did a great job here) | | There might be more, so what Pluto will need is "pluggeable" cross context | dispatcher.
Doesn't ServletContext.getContext() do the job?
JavaDoc, Servlet 2.2: -------------------- public ServletContext getContext(java.lang.String uripath)
Returns a ServletContext object that corresponds to a specified URL on the server.
This method allows servlets to gain access to the context for various parts of the server, and as needed obtain RequestDispatcher objects from the context. The given path must be begin with "/", is interpreted relative to the server's document root and is matched against the context roots of other web applications hosted on this container.
In a security conscious environment, the servlet container may return null for a given URL. ----------------------
Endre.
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
- -- --- -----=[ shuber2 at jahia dot com ]=---- --- -- - www.jahia.org : A collaborative source CMS and Portal Server
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
