[英]JSP - Include a file from the resources folder
您不應該在WEB-INF
任何子目錄中包含 .jsp 文件,並且如果webapp
是您的 Web 應用程序的上下文根,則您無法在其之外包含任何內容,因為 include 指令和標准標記都僅適用於文件在上下文根下。
如果您要將整個resources
目錄移動到webapp
下,那么您將能夠使用以下方法之一:
<%@include file="/resources/static/template/index.html"%>
或者
<jsp:include page="/resources/static/template/index.html"/>
我已經這樣解決了
嘗試使用:
<%@include file="../../resources/static/template/index.html" %>
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.