java - How to include JSP from jar lib -
I have a lot of obe project, which is normal for other applications. I want to put one of the few JSP files and then include and
& lt;% ...
but I do this Not able to.
Is there any way to get this?
If there is one, which is better, include instructions ( @include file
..) or verb ( & lt; jsp: included page
...)?
thanks
I only know one way
- Put JSP in the
/ETA-INF / Resources
folder. - Create a 'Lib' folder inside the web-ins folder War.
- Keep jars in the lib folder of the war (containing JSP in the
/ META-INF / resources
folder). - The main JSP where you want to keep this external JSP in jar, use the following statement:
& lt; Jsp: include page = "/ myJSP.jsp" & gt; & Lt; / Jsp: include & gt;
Note that JSP requires a 'JSP file name' in front of a pure path for JSP (and hence in the jar in the liberation folder), rather than in the current path where the main JSP is lying .
This will definitely work.
Comments
Post a Comment