我得到了一些(很多)开头带有注释代码的 jsp 文件。
看起来
<%-------------------------------------------%>
<%-- All the comment text about the author --%>
<%-- And of course the company --------------%>
<%-------------------------------------------%>
我在 Tomcat 7.0.30 上安装应用程序并收到以下错误:
org.apache.jasper.JasperException: /path/to/jsp/file.jsp
(line: 13, column: 4) Unterminated <%-- tag
最后注释行是第 13 行!
当我把第13行的注释代码改成
<%-- ----------- --%>
一切正常!
问题一:
为什么第 1 行没有问题? 编辑: 因为它在第 2 行终止了!
问题2:
<%--------%> 作为评论是“不允许”的,这对吗?
最佳答案
<%-------%>
允许作为评论,因为我自己尝试过。
关于jsp - jsp中的注释语法,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13048765/