Accessing servletContext of another web app from Snipsnap
2005-08-04 08:08:35 GMT
Hi,
I am trying to access from SnipSnap's filters (GZIPFilter and InitFilter) some variables from another web application.
I have the following webapps: "/app1" and "/snipsnap". I have
configured app1 and successfully tested the access to its variables
using a second app called "/app2".
In GZipFilter or InitFilter I wrote the following sequence (pretty standard for retrieving variables from other webapps):
-------------------------------------------------
FilterConfig filterConfig = null;
public void init(FilterConfig filterconfig) {
this.filterConfig = filterconfig;
}
public void doFilter(ServletRequest req, ServletResponse res, FilterChain chain)
throws IOException, ServletException {
// filterConfig is stored
ServletContext servletContext = filterConfig.getServletContext();
ServletContext context = servletContext.getContext("/app1");
System.out.println(">>>>>>>>>> context = " + context);
..............
}
----------------------------------------
At this point the context of /app1 is always null, no matter what I do.
The same context is valid and not-null when using the same construction
from my test /app2 (which uses the same filter).
Both /app1 and /snipsnap have their context.xml file located in META-INF with crossContext set to true.
Appreciate any feedback,
Regards,
Marius
_______________________________________________ SnipSnap-Users Mailing List snipsnap-users <at> snipsnap.org | http://snipsnap.org/ http://snipforge.org/cgi-bin/mailman/listinfo/snipsnap-users
RSS Feed