[英]Taglib inheritance in jsp:include
是否可以從父JSP的“后代”繼承taglib或導入?
我舉個例子
header.jsp
<%@ page contentType="text/html" isELIgnored="false"
import="org.something.utils.Constants"%>
//some code, Constants class is available here
index.jsp
<jsp:include page="template/header.jsp" />
//Constants is not available, I get a JasperException: Unable to compile class for JSP
同樣,taglibs繼承似乎不起作用。 那么有沒有辦法使這項工作呢?
Taglib和導入不會被繼承,並且標記中的所有內容也不能被繼承或通過頁面傳遞(JspContext和request屬性除外)。
您在這里有兩個選擇:
編輯定義JSP隱式包括:
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.