Search code examples
eclipsejspeditorcontent-assist

sysout in JSP eclipse


Eclipse Specific : content assist

Problem statement:

if I type sysout in JSP and press ctrl+spacebar then it should expand to System.out.println

Description

I am using sysout in Java for quite some time. but whenever I tried to use sysout in JSP I am getting error as content assist is not available at this location

I have also tried to insert template for JSP editor for sysout(Copied from template of Java Editor) but still I am getting same error.

Can anyone please suggest solution or any references where I can get help.


Solution

  • If you love shortcuts:

    syso is a shortcut for sysout
    

    Hey, you can define a jsp-template with value

    (window->preferences->web->jspfiles->editor->templates)

    <%System.out.println("${cursor}");%>
    

    So you can switch to JSP-Templates using Ctrl+Spacebar+Spacebar