Are JSP expressions evaluated inside HTML comments of a JSP page?
i.e What would server output in this case?
<!--
Jeremy <%="Flowers"%>
-->
Will the expression be resolved or will it remain as an expression in the HTML comment
a)
<!--
Jeremy <%="Flowers"%>
-->
or b)
<!--
Jeremy Flowers
-->
Yes, the expressions will be resolved. The JSP page doesn't even know it is writing in HTML format, so it doesn't interpret anything HTML-specific.
You can also write plain text using JSP, or JSON, or whatever you like.
Those are html comments, not jsp comments. So, all jsp code inside is still evaluated.
There's also jsp-specific way to comment content: <%-– ... -–%>
. Content inside won't be evaluated by the server and won't be passed to the browser. So, it acts as html comment too.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With