facebook

JSP formatter looks awful

  1. MyEclipse IDE
  2.  > 
  3. Java EE Development (EJB, JSP, Struts, XDoclet, etc.)
Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #308317 Reply

    If I have this snippet of JSP (I am just showing the 1st part of the file):

    <%@include file="/WEB-INF/jsp/common/taglibs.jsp"%>
    
    <fmt:message var="title" key="contactForm.title"/>
    <s:layout-render name="/WEB-INF/jsp/common/layout_menu.jsp"
      title="${title}" currentSection="ContactList">
      <s:layout-component name="body">
        <s:form beanclass="${actionBean.class}">
          <%-- START:contactId --%>
          <div><s:hidden name="contact"/></div>
          <%-- END:contactId --%>
          <table class="form">
            <tr>
              <td><s:label for="contact.email"/>:</td>
              <td><s:text name="contact.email" class="required"/></td>
              <td class="error"><s:errors field="contact.email"/></td>
            </tr>
            <tr>
              <td><s:label for="contact.firstName"/>:</td>
              <td><s:text name="contact.firstName"/></td>
              <td class="error"><s:errors field="contact.firstName"/></td>
            </tr>
            <tr>
              <td><s:label for="contact.lastName"/>:</td>
              <td><s:text name="contact.lastName"/></td>
              <td class="error"><s:errors field="contact.lastName"/></td>

    </tr>

    and I format it I get:

    <%@include file="/WEB-INF/jsp/common/taglibs.jsp"%>
    
    <fmt:message var="title" key="contactForm.title" />
    <s:layout-render name="/WEB-INF/jsp/common/layout_menu.jsp" title="${title}" currentSection="ContactList">
        <s:layout-component name="body">
            <s:form beanclass="${actionBean.class}">
                <%-- START:contactId --%>
                <div>
                    <s:hidden name="contact" />
                </div>
                <%-- END:contactId --%>
                <table class="form">
                    <tr>
                        <td>
                            <s:label for="contact.email" />
                            :
                        </td>
                        <td>
                            <s:text name="contact.email" class="required" />
                        </td>
                        <td class="error">
                            <s:errors field="contact.email" />
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <s:label for="contact.firstName" />
                            :
                        </td>
                        <td>
                            <s:text name="contact.firstName" />
                        </td>
                        <td class="error">
                            <s:errors field="contact.firstName" />
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <s:label for="contact.lastName" />
                            :
                        </td>
                        <td>
                            <s:text name="contact.lastName" />
                        </td>
                        <td class="error">
                            <s:errors field="contact.lastName" />
                        </td>
                    </tr>    

    This is the SAME block of JSP code in both cases.

    The formatting is unfortunately terrible. X/HTML and XML really differ in how they SHOULD be formatted as additional line feeds in X/HTML may affect flow and also make the X/HTML harder to read and less compact (yes displaying a web page a 10000 times adds up if you have 20/30/etc… additional line feeds on the page).

    As for XML this type of formatting is fine and actually helps with legibility IMO.

    My biggest issue though is clarity and looks for X/HTML. How can I adjust this in MyEclipse so that say for example <td>’s stay on the same line?

    P.S. I have seen complaints that go back to 2004/5 and MyEclipse 3.5/4. I really hope there has been some significant improvement since then…. 🙂

    #308326 Reply

    support-joy
    Member

    nikolaos2012,

    Thank you for bringing this to our notice. I shall escalate this to dev team members for further investigation.

    #308718 Reply

    Joy,

    2 weeks have passed and I am curious what has come of your escalation to the dev team members????

    #317324 Reply

    Gaurav Kumar
    Member

    @support-joy wrote:

    nikolaos2012,

    Thank you for bringing this to our notice. I shall escalate this to dev team members for further investigation.

    The JSP formatter is terrible.
    I have knack of formatting code after writing few lines … and later I have to press undo because JSP formatter is really stupid.

    Plz fix this ASAP. I am using the latest MyEclipse v9.0 (Build id: 9.0-20110318)

    #317343 Reply

    support-joy
    Member

    gauravbaadshah,

    I have raised the priority of this issue. Sorry for the inconvenience.

Viewing 5 posts - 1 through 5 (of 5 total)
Reply To: JSP formatter looks awful

You must be logged in to post in the forum log in