views:

57

answers:

2

Hi, all.

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

+1  A: 

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.

Ehsan
A: 

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.

dpb
Unfortunately, the code is too mangled for the built-in Eclise functionality to do much good.
IVR Avenger