我有我的所有JSP禁用小腳本在web.xml:導入自定義標籤庫
<jsp-config>
<jsp-property-group>
<url-pattern>*.jsp</url-pattern>
<scripting-invalid>true</scripting-invalid>
</jsp-property-group>
</jsp-config>
但我需要導入正在使用類似這樣的一些自定義標籤庫:
<%@ taglib prefix="utils" uri="/tags-utils" %>
如何做,而無需使用小腳本我導入? 另外,如何避免使用以下內容?
<%@ page language="java" contentType="text/html; charset=UTF-8" %>
scriptlet移除的決定是爲了避免由多個開發人員編寫的項目中的scriptlet混亂。
如果無法使用scriptlet更改導入,那麼除非<%@ taglib
或<%@ page
以外的其他用途,我將如何禁用它?
試圖從
<%@ taglib prefix="s" uri="/struts-tags" %>
改變
<jsp:directive.tagLib prefix="s" uri="struts-tags" />
但Servlet的引發我一個錯誤:
[org.apache.catalina.core.ContainerBase.[jboss.web].[default-host].[/portal].[jsp]] (http-localhost-127.0.0.1-80-3) Servlet.service() for servlet jsp threw exception: org.apache.jasper.JasperException: /index.jsp(2,18) <jsp:directive.tag directive can only be used in a tag file
還有什麼我有什麼關係?
正是我需要的 –