檢查 JSP 檔中保留的序列 '#{'

此規則會標示使用的 JSP 檔中的 '#{' 序列。 現在在 JSP 2.1 中,語法 #{} 是保留關鍵字。 在 JSP 2.1 中使用包含序列 #{} 的較舊 JSP 檔時,這些 JSP 檔將產生錯誤。

如果要偵測 #{ 序列,必須符合下列條件:

請注意下列項目:

自動修正將在 #{ 語法之前加入轉義字元。

範例:
<h1>This is an example of template text that will be detected: #{detected}</h1>

自動修復程式會將此代碼變更為:

<h1>This is an example of template text that will be detected: \#{detected}</h1>

另外,還有不同的方法可以停用「表示式語言 (EL)」:


優先順序相關附註:
頁面指引的 isELIgnored 和 deferredSyntaxAllowedAsLiteral 屬性優先於 web.xml 中相應的元素和值。 這些頁面指引屬性會置換 web.xml 中相應元素的值。

如需相關資訊,請參閱: