struts2 - 如何在 Struts 标签中添加注释?

标签 struts2 comments

我有以下标签,如何在其中添加评论?

<s:select id="productPrice.product" 
          name="productPrice.product"
          headerKey="0" 
          headerValue="-- Select Product --"
          list="products" 
          listKey="id" 
          listValue="name"
          value="productPrice.product.id"
          theme="simple"
          onchange="getDisplayName(value)"       <!-- How to comment here ? -->
          />

我试过了 :
<!-- abc -->
<%-- abc --%>
// abc

它们都不起作用,正确的方法是什么?

最佳答案

您不能将评论放在标签中。您必须将它们放在 Struts2 标签的上方或下方。 Struts2 标签与 HTML 标签没有区别,因此:

  • Can XML comments go anywhere?
  • HTML Comments inside Opening Tag of the Element
  • 关于struts2 - 如何在 Struts 标签中添加注释?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12584896/

    相关文章:

    java - Struts 1.x 与 Struts 2.x

    java - 从 Struts 1 迁移到 Struts 2

    java - Struts 不从参数列表中排除提交操作

    struts2 验证器表达式

    matlab - 是否有编写 matlab 文件开头注释的标准?

    python - 为什么 Python 没有多行注释?

    c++ - 数组内注释中的双反斜杠

    MySQL Workbench 6.2 在创建 View 后删除了我的所有评论

    java - 在 webapp 外部的 jsp 上显示图像

    internet-explorer - IE 条件注释 : lt IE 7 = lte IE 6?