score:89

Accepted answer

i use shift+ctrl+/ to add block comment in both xml and jsp files (works at the line level or for a selected block).

just in case, if you are looking for a particular shortcut, you can use shift+ctrl+l to show key assist (i.e. the commands and their bindings).

score:2

in mac, for xml:

command+/ - to comment a line or selected block of lines

command+\ - to uncomment a line or selected block of lines

this works in eclipse photon (4.8.0)

score:7

in eclipse they use same kind of shortcut to do this which is for:

i found ctrl + shift + c works in xml and jsp.

single line

comment ctrl + /

uncomment ctrl + /

multiline

comment ctrl + shift + /

uncomment ctrl + shift + \ (note the backslash)

hope this helps!

score:24

i found ctrl + shift + c works in jsp too, it works like:

<tiles:insertdefinition name="" >
</tiles:insertdefinition>

<!--<tiles:insertdefinition name="" >-->
<!--</tiles:insertdefinition>-->

add comment tag line by line, and select the sentences, use ctrl + shift + c again can toggle remove the comments.

ctrl + shift + / add block comment in jsp, works like:

<tiles:insertdefinition name="" >
</tiles:insertdefinition>

<!--<tiles:insertdefinition name="" >
    </tiles:insertdefinition>                       
-->

can use ctrl + shift + \ to remove the block comment.

ps: i want to find out, which eclipse shortcut can add/remove <%-- --%> comment in jsp?

score:47

i believe ctrl+shift+c works in xml, not sure about jsp. i think it lacks consistency in the various editors, and some don't have this shortcut.


Related Query

More Query from same tag