【问题标题】:Is there any way to write comments using jstl?有没有办法使用jstl写评论?
【发布时间】:2015-10-28 06:54:38
【问题描述】:

作为一种良好的编码习惯,我们不应该在 jsp 中使用 scriptlet。 我想在我的 jsp 中为其他开发人员编写 cmets,但不想在页面转换为 html 时将其显示给客户端。

有什么方法可以使用 jstl 或 El 编写以下代码?

<% 
//for perfromance we redirect control to this jsp
//as this jsp don't load unused dom ,css , js
%>

我在网上找不到任何东西?

【问题讨论】:

  • 为什么不使用 JSP cmets ? &lt;%-- comment --%&gt;
  • 仅供参考:JSP 的后续 Facelets 可以配置为在呈现期间跳过纯 HTML cmets。另见 a.o. stackoverflow.com/q/3388109
  • 我正在寻找 kinda tag 来写 cmets。

标签: jsp jstl el jsp-tags


【解决方案1】:

不,

您不能使用 EL 语言编写评论,但是您可以使用 JSP cmets,这将对用户隐藏并且不需要脚本

         <%-- This is a Hidden Comment.  --%>

【讨论】:

    猜你喜欢
    • 2020-05-15
    • 2015-12-11
    • 1970-01-01
    • 2016-01-10
    • 2020-10-28
    • 1970-01-01
    • 2019-03-16
    • 2018-07-02
    • 1970-01-01
    相关资源
    最近更新 更多