Sharing shared jsp in several wars in the EAR

We have a large application with 13 modules. Depending on customer requirements, we should be able to deploy module modules with a module module + client. We plan to break the application into several wars. Now the problem is that we have some common jsp like header.jsp, error.jsp etc. Is there a way by which we can save the common jsp in the main war and the rest of the wars, can use it or do I need to copy these jsp in invisible wars during the build process. I know that CSS and Javascript files can be divided into several wars in ear packing, but are not sure about jsp.

+5
source share
1 answer
Good question. You will be happy to hear that the answer is yes, although it depends a lot on how your servlet container is configured.

Executed using the JSTL tag <c:import>, which has an optional attribute context, which is defined as:

The context name (starting with a) of some other local web application to import the resource from.

Say you have a webapp. Deployed under the context root /A, and webapp B is deployed to /B, then JSP in can include x.jspfrom B using:

<c:import context="/B" url="x.jsp"/>

, , . , Tomcat crossContext true.

+4

All Articles