如何评论一个JSP表达式? [英] How comment a JSP expression?

查看:130
本文介绍了如何评论一个JSP表达式?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何评论JSP表达式,例如:<%= map.size()%>

How can I comment a JSP expression like: <%= map.size() %>

是否有<%= // map.size()%>?

推荐答案

Pure JSP注释如下所示:

Pure JSP comments look like this:

<%-- Comment --%>

所以如果你想保留 = ,你可以这样做:

So if you want to retain the "=".you could do something like:

<%--= map.size() --%>

关键是<%= 定义一个表达式的开头,其中你不能将正文留空,但是如果纯JSP注释不吸引你,你可以这样做:

The key thing is that <%= defines the beginning of an expression, in which you can't leave the body empty, but you could do something like this instead if the pure JSP comment doesn't appeal to you:

<% /*= map.size()*/ %>

JavaServer Pages技术版本1.x语言的代码约定有关您可用的不同注释选项的详细信息(但是完全缺乏链接目标,所以我无法直接链接到相关部分 - boo!)

Code Conventions for the JavaServer Pages Technology Version 1.x Language has details about the different commenting options available to you (but has a complete lack of link targets, so I can't link you directly to the relevant section - boo!)

这篇关于如何评论一个JSP表达式?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆