I have many JSP files with EL expressions of the form ${foo.bar.baz.phleem1}
, ${foo.bar.baz.phleem2}
etc. (the first two or three segments are equal). To reduce EL lookups I am in the process of refactoring these pages:
Source:
<c:out value="${foo.bar.baz.phleem1}" />
<c:out value="${foo.bar.baz.phleem2}" />
<c:out value="${foo.bar.baz.phleem3}" />
After refactoring:
<c:set var="baz" value="${foo.bar.baz}" />
<c:out value="${baz.phleem1}" />
<c:out value="${baz.phleem2}" />
<c:out value="${baz.phleem3}" />
I know I can do most of this with searching / replacing, but it feels unsafe as it ignores code structure.
Is there any support for this type of refactoring in either Eclipse or IntelliJ Idea?