We're trying to embed Magnolia-managed content into some of the JSPs of an existing web app. In Tomcat we deployed and set up a magnoliaPublic context that runs along our existing app context (i.e. two different WAR files). In the browser you can access both:
http://localhost:8080/app/test.jsp
andhttp://localhost:8080/magnoliaPublic/footer
So, for example, we'd like /app/test.jsp
to include a Magnolia page like /magnoliaPublic/footer
(just a div). We managed to do it by adding:
<c:import url="http://localhost:8080/magnoliaPublic/footer" />
to /app/test.jsp
. This is almost fine, but a relative include would be best:
<c:import context="/magnoliaPublic" url="/footer" />
This latter line throws
The requested resource (/magnoliaPublic/footer) is not available
I suspect this is due to the way Magnolia's filter chain works, though it's set to dispatch INCLUDE and all server/filters/dispatching/* entries have toMagnoliaResources set to true.
Any hint will be appreciated.
Thank you.
Tomcat does not allow you to access another Servlet Context by default. I guess that is the reason why your
c:import
using thecontext
attribute fails.Tomcat has the
crossContext
attribute which configures this:Source: http://tomcat.apache.org/tomcat-7.0-doc/config/context.html
Enabling
crossContext
might solves your problem.IMHO this has nothing to do w/ Magnolia and all to do w/ how c:import works.
Did you try to verify that your request reached Magnolia's filter chain at all?
You can do so by enabling request tracking on your app server, inserting proxy in between or simply by adding
info.magnolia.debug.DumpHeadersFilter
filter in Magnolia's filter chain and observing the log.HTH,
Jan