首页 > 解决方案 > 在 HTML 注释中描述 jsp:setProperty 操作标记时出现内部服务器错误

问题描述

问题:是否需要在 JSP 页面的 HTML 注释部分中“转义”jsp 标记?


背景:

我们有有效的 JSP 代码,我们在其中通过描述jsp:setProperty动作标记来详细说明 HTML 注释部分。换句话说,我们扩展了

<!--
blah blah blah
-->

<!--
blah blah blah
<jsp:setProperty name="myBean" property="*"/>
more blah-blah-blah
-->

请记住,jsp:setProperty 操作标记完全在 HTML 注释的范围内。

在这个看似无害的更改之后,我们的应用程序抛出了以下异常:

HTTP Status 500 - Internal Server Error 

type Exception report

message Internal Server Error

description The server encountered an internal error that prevented it from fulfilling this request.

exception 
org.apache.jasper.JasperException: java.lang.NullPointerException

root cause 
java.lang.NullPointerException

标签: jsp

解决方案


推荐阅读