How do you add a new variable to be inserted into a Java code template. How do I add a variable to the list in Window->Preferences->Java->Code Style->Code Templates->Code->N
To add on to the conversation, I also wanted to insert a custom variable into a template. My issue was that I wanted to insert a variable from jsp/jstl definition inside the template.
(I.E. <c:set var="myVariable" value="${requestScope.variableName}" />
)
This apparently caused some issues because templates already use the ${}
syntax to help resolve its own variables.
So simple solution I included an additional $
to the pattern in the template. Two $$
signs resolves it to a single $
sign, hence giving me exactly what I wanted. Hopefully this helps the poster or someone with similar situation.