0

In Eclipse (version 2021-09) I would like to use the sysout template in the scriptlet area of a JSP page.

So, in my JSP editor I have:

...

<%
...
[cursor here]
...
%>
...

When I now type sysout how can I make it expand to System.out.println("[cursor here]");?

I tried a new JSP template like this:

New Tpl in Eclipse for sysout

But it does not work inside the scriplet tags.


PS: I saw the question sysout in JSP eclipse - Stack Overflow, but the answers do not cover the case inside the scriptlet tags.

halloleo
  • 9,216
  • 13
  • 64
  • 122
  • why would you sysout from a servlet? there is maybe no output window. – Scary Wombat Oct 26 '22 at 01:32
  • The message will probably appear on stdout of the JVM not on the page. Also, is there any content assist for `System.out.` inside scriptlets? – LMC Oct 26 '22 at 01:50
  • @ScaryWombat Standard out is written to Tomcats console window - great for a quick debug! :-) – halloleo Oct 26 '22 at 02:01
  • 1
    Content Assist in scriptlets is solely for Java, and Java templates aren't supported there. You'll have to open a feature request. – nitind Oct 26 '22 at 02:22

1 Answers1

-3

go to the preferences --> Java --> Editor --> Content Assist at the bottom: "auto activation triggers for Java" and put in:

abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ._
CertainPerformance
  • 356,069
  • 52
  • 309
  • 320
  • 2
    Your answer could be improved with additional supporting information. Please [edit] to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – Community Jan 03 '23 at 00:36