Tutorial :Free text editor to fix indentation of messy JSPs?



Question:

I'm developing a VXML IVR application in Eclipse, and it's chock full of messy JSPs. Some of my (inherited!) source looks like this:

<%if (useLegacy) {%>  <form id="getLegacy">  <block>  <if cond="gblFirstRunThroughFlag=='true'">  <%--Use special "extra info" menu to retrieve the legacy ID--%>  <goto next="getLegacyInfoFirst.jsp"/>  <else>  <goto next="getLegacyInfo.jsp"/>  </if>  </block>  </form>  <%}%>  

I would love to find a tool that will fix the indentation, so that the scriptlets and the markup are a bit easier to read:

<%if (useLegacy) {%>      <form id="getLegacy">          <block>              <if cond="gblFirstRunThroughFlag=='true'">                  <%--Use special "extra info" menu to retrieve the legacy ID--%>                  <goto next="getLegacyInfoFirst.jsp"/>              <else/>                  <goto next="getLegacyInfo.jsp"/>              </if>          </block>      </form>  <%}%>  

Does such a tool exist in the Windows world, gratis?

Thanks!
IVR Avenger


Solution:1

I'm not sure of a free one, but JPadPro does automatic tabbing with JSP you can download a free demo.

I couldn't figure out how to make this a comment since it's not exactly an answer as you're looking for a free text editor.


Solution:2

Since you are already using Eclipse, you have a free editor included. You could hit CTRL+SHIFT+F in the JSP editor and it will format it, adding also indentations.

You might have to do some hand tweaking for some long tags (they will be split on more lines for readability) but it usually does a pretty good job of formatting if your JSPs aren't a complete mess.


Note:If u also have question or solution just comment us below or mail us on toontricks1994@gmail.com
Previous
Next Post »