Java – how to include JSP files from different projects in my project
How do I include JSP files from different projects in my project?
<%@ include file="./common/webappfooter.jsp"%>
The above code does not work
Solution
This is only valid if another project is bundled in the style of the jar file in the / WEB-INF / lib folder of the main webapp project and the JSP file is placed in the / meta-inf / Resources folder of another project
So, if you have / meta-inf / resources / common / webappfooter. Com in another project JSP, the following include should do:
<jsp:include path="/common/webappfooter.jsp" />
If you use an IDE with a little self-respect, you can configure it to automatically bundle another project as a jar of / WEB-INF / lib of webapp project It's not clear what ide you're using, but in eclipse, add other projects as deployment assemblies to the properties of the main webapp project
In eclipse, to create a project with the correct folder structure, select the web fragment project wizard