Can I include JSP expressions in <!-- --> style comments?

John Zukowski

Sure. You can include code like:

  Loaded: <%= new Date() %>
in your code with no problems. Of course, only those who view the source will see the generated output, but it will be generated as requested.

It doesn't make sense to try to put code in <%-- --%> style comment as these comments are only visible in the preprocessed JSP source files.