What @Mero provided (see comments on answer above) might not be an exact answer, but creating a JSP Template probably the closest thing that I've found.
A few notes for anyone that wants to go that route:
Create a new template through menu Window->Preferences, then in the drill down menu navigate to Web->JSP Files->Editor->Templates. Click New.
Name is a shortcut you can type (the same way typing sysout ctrl+space
in Java is a shortcut for System.out.println()
). I suggest something simple like el
. This allows you to type e l ctrl-space
instead of $ { ctrl-space
to pull it up.
Context tells it when it should appear in intellisense. I suggest creating two of this template where one has a context of JSP Attribute value and the other has a context of All JSP.
Description is just informative. Put whatever you want. I put 'EL Script' myself.
Pattern is where you put what will be inserted. Put $${${cursor}}
or $${${script}}
, depending on preference. See below for explanation on the differences.
In Eclipse Templates ${}
is how you put variables in the template, so to make it actually print ${}
you have to escape the $
with a $$
leading to $${}
.
The predefined variable ${cursor}
defines where the cursor is after intellisense replaces the el
, so to have the cursor appear in between the curly braces you want to do this: $${${cursor}}
.
Using any variable that is not predefined (in this case, ${script}
) will simply put in that variable with a box around it and allow you to type over it and press enter when you're done, allowing you to move to the end of the closing curly brace.
Note: I understand that this is not an actual answer, but rather is a workaround. I'm putting it here simply so that those who are fine with a workaround can know how to go about doing it.
Edit
For those that don't like having to type ctrl-space
, a workaround could be to have the template name start with<
since on JSP pages, the <
opens the intellisense, so for instance, you could have the name be <el
or <$
.
$ { ctrl-space
. Turning off auto-close is a better solution requiring less mental effort. And neither solution fully hits the mark. – Whom