Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Possible to comment-out JSTL code?

Tags:

If you want to temporarily comment-out a piece of JSTL code that you may re-enable later, is this possible?

Would this work?

<!--<c:out value="${someVar}"/>--> 
like image 248
faq Avatar asked Oct 12 '10 11:10

faq


People also ask

How do I comment in JSTL?

Add JSP comment using the <%-- --%> tags.

What is difference between JSTL and JSP?

JSP lets you even define your own tags (you must write the code that actually implement the logic of those tags in Java). JSTL is just a standard tag library provided by Sun (well, now Oracle) to carry out common tasks (such as looping, formatting, etc.).

Can we use JSTL in HTML?

No. It is not possible to have JSTL in HTML page.


1 Answers

When you write such comment in your JSP file:

<!-- <c:out value="${someVar}"/> --> 

This means that this comment will be outputed, i.e. present in the generated HTML page. If you want to hide your code, use the JSP comments:

<%-- <c:out value="${someVar}"/> --%> 
like image 53
Romain Linsolas Avatar answered Sep 18 '22 14:09

Romain Linsolas