How can I add JSP comments (instead of HTML comments) in Eclipse? [message #991116] |
Mon, 17 December 2012 07:08  |
Eclipse User |
|
|
|
When editing JSP pages in Eclipse, I can comment out the current line or selected block with HTML comments using the keyboard shortcut CTRL+SHIFT+/:
However, in JSP files, I usually want to use a JSP comment instead:
Is there a way to add these comments with a keyboard shortcut instead/as well?
A minimum of 25 shiny Stack Overflow rep points are available. See Stack Overflow question #13912025
[Updated on: Mon, 17 December 2012 11:31] by Moderator
|
|
|
Re: How can I add JSP comments (instead of HTML comments) in Eclipse? [message #991404 is a reply to message #991116] |
Tue, 18 December 2012 17:28   |
Eclipse User |
|
|
|
Hi Paul,
Unfortunately, there are no explicit keybindings for switching between the styles of comments used in a JSP file.
Instead, the keybinding for Ctrl+Shift+/ is overloaded in JSPs. If the selected region includes JSP-specific syntax (scriptlets, custom tags, etc.), Ctrl+Shift+/ inserts the JSP comment. So for example, <div><c:out value="test"></c:out></div> will be wrapped entirely in a JSP comment.
On the other hand, content that is not JSP-specific will use regular comments. For example, <div></div> will be wrapped in the typical HTML-style comment.
It changes once again to use Java-style comments, if only the Java content of a scriptlet is selected.
|
|
|
|
Powered by
FUDForum. Page generated in 0.09557 seconds