How do you comment out in JSP?
Category:
technology and computing
web development
To add comments in a JSP page one should perform the following steps:
- Create a jsp page that begins with the <%code fragment%> scriptlet.
- Keep any html tags in the page outside the scriptlet.
- Add JSP comment using the <%-- --%> tags.
- Add HTML comments using the <!
Furthermore, which syntax is used to comment JSP?
A Test of Comments
S.No. | Syntax & Purpose |
---|---|
1 | <%-- comment --%> A JSP comment. Ignored by the JSP engine. |
2 | <!-- comment --> An HTML comment. Ignored by the browser. |
3 | <\% Represents static <% literal. |
4 | %> Represents static %> literal. |
In this manner, what are JSP comments?
JSP comment marks text or statements that the JSP container should ignore. A JSP comment is useful when you want to hide or "comment out", a part of your JSP page.
Answer: There are two types of comments are allowed in the JSP. These are hidden and output comments. A hidden comments does not appear in the generated output in the html, while output comments appear in the generated output.