facebook

v3.8.3 inexplicable JSP validation error

  1. MyEclipse Archived
  2.  > 
  3. Bugs
Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #222620 Reply

    mkong
    Member

    Hi.

    I got v3.8.3 two days ago. When trying to build a web project (Web Capabilities enabled), during JSP validation, the error

    ‘The end tag “</logic:equal-” is unbalanced’

    appeared twice deeming a JSP invalid, pointing to lines
    (in the subject JSP) that don’t seem to shed any light on the error reported.

    I use Struts tags within the JSP’s; the Struts libraries are saved under my project work space, and specified in the web project properties as part of the required libraries. There is a host of JSP’s in the project, but no other validation errors were reported, beside the above-mentioned one.

    The subject JSP is indeed valid (no problem at run-time, no problem at compile-time when compiled with JBuilder).

    Below is the subject JSP content as is. No clue how the unbalanced tag is detected!


    <%@ page import=”com.adopt.aop.altitude.web.constants.*” %>
    <%@ page import=”com.adopt.aop.altitude.web.view.*” %>
    <%@ taglib uri=”/tags/struts-bean” prefix=”bean” %>
    <%@ taglib uri=”/tags/struts-html” prefix=”html” %>
    <%@ taglib uri=”/tags/struts-logic” prefix=”logic” %>
    <%@ taglib uri=”/tags/struts-tiles” prefix=”tiles” %>

    <html>
    <head>
    <html:base/>
    <link rel=”stylesheet” type=”text/css” href=”css/all.css”>
    <script type=”text/javascript”>

    <!–
    <% boolean continueToPull=false; %>
    <logic:empty name=”activeSessionId”>
    <% continueToPull=true;%>
    <bean:define id=”activeSessionId” value=”<%=request.getParameter(“activeSessionId”)%>”/>
    </logic:empty>

    function displaySection(direction) {
    document.fractionalDisplayForm.section.value = direction;
    document.fractionalDisplayForm.submit();
    }

    function showDetails(tripId) {
    document.analyzeTripForm.tripId.value = tripId;
    document.analyzeTripForm.target = ‘analyzerTrip<bean:write name=”activeSessionId”/>’;
    document.analyzeTripForm.submit();
    document.analyzeScoreForm.tripId.value = tripId;
    document.analyzeScoreForm.target = ‘analyzerScore<bean:write name=”activeSessionId”/>’;
    document.analyzeScoreForm.submit();
    }
    function sortColumn(column) {
    document.sortForm.sortColumn.value = column;
    document.sortForm.submit();
    }
    function getProgress() {
    <logic:notEmpty name=”analysisNotFinished”>
    document.getAnalyzeProgressForm.submit();
    return;
    </logic:notEmpty>
    <% if (continueToPull) { %>
    document.getAnalyzeProgressForm.submit();
    return;
    <% }%>
    return;
    }
    //–>
    </script>
    </head>
    <% if (ApplicationContainer.baProgressQueryRate <= 0) { %>
    <body style=”margin: 2px” >
    <% } else { %>
    <body onLoad=”setTimeout(‘getProgress();’, <%=ApplicationContainer.baProgressQueryRate%>);” style=”margin: 2px” >
    <% } %>
    <html:form action=”/analyzeProgress” name=”getAnalyzeProgressForm” type=”org.apache.struts.action.DynaActionForm”>
    <input type=”hidden” name=”activeSessionId” value=”<bean:write name=”activeSessionId”/>”/>
    </html:form>
    <html:form action=”/analyzeTripAction” name=”analyzeTripForm” type=”org.apache.struts.action.DynaActionForm”>
    <input type=”hidden” name=”activeSessionId” value=”<bean:write name=”activeSessionId”/>”/>
    <input type=”hidden” name=”tripId”/>
    </html:form>
    <html:form action=”/analyzeScoreAction” name=”analyzeScoreForm” type=”org.apache.struts.action.DynaActionForm”>
    <input type=”hidden” name=”activeSessionId” value=”<bean:write name=”activeSessionId”/>”/>
    <input type=”hidden” name=”tripId”/>
    </html:form>
    <html:form action=”/sortAnalysisAction” name=”sortForm” type=”org.apache.struts.action.DynaActionForm”>
    <input type=”hidden” name=”activeSessionId” value=”<bean:write name=”activeSessionId”/>”/>
    <input type=”hidden” name=”sortColumn”/>
    </html:form>
    <!– For fractional display ——–>
    <% String firstIndex = “-1”;
    String lastIndex = “-1″;
    %>
    <logic:notEmpty name=”firstIdx”>
    <% firstIndex= String.valueOf(((Integer)request.getAttribute(“firstIdx”)).intValue()); %>
    </logic:notEmpty>
    <logic:notEmpty name=”lastIdx”>
    <% lastIndex= String.valueOf(((Integer)request.getAttribute(“lastIdx”)).intValue()); %>
    </logic:notEmpty>
    <html:form action=”/analyzeFractionalDisplayAction” name=”fractionalDisplayForm” type=”org.apache.struts.action.DynaActionForm”>
    <input type=”hidden” name=”activeSessionId” value=”<bean:write name=”activeSessionId”/>”/>
    <input type=”hidden” name=”section”/>
    <input type=”hidden” name=”currentFirstIdx” value=”<%=firstIndex%>”/>
    <input type=”hidden” name=”currentLastIdx” value=”<%=lastIndex%>”/>
    </html:form>
    <!———————————–>
    <logic:notEmpty name=”taskList”>
    <tiles:insert page=”/analyzerMenu.jsp”/>
    <%– Non-participating bids –%>
    <table border=”0″ cellspacing=”3″ cellpadding=”0″>
    <tr><td align=”left” class=”title2″ style=”color: red”>
    <bean:message key=”analyzer.nonParticipatingBids.title”/></td></tr>
    <tr><td><% boolean nonPart = false; %>
    <table border=”0″ cellspacing=”2″ cellpadding=”2″>
    <bean:define id=”autoBidMode” name=”activeSession” property=”currentAutoBidMode” type=”java.lang.Boolean” toScope=”request”/>
    <bean:define id=”displayClass” value=”nonParticipatingBids” toScope=”request”/>
    <logic:iterate id=”aggregate” name=”activeSession” property=”bidCache.bidAggregates”>
    <logic:equal name=”aggregate” property=”participating” value=”false”>
    <% nonPart = true; %>
    <tr class=”nonParticipatingBids”>
    <logic:present name=”activeSession” property=”availableBidScopes”>
    <td align=”left” valign=”top”><% String scopeKey = “bidoption.property.” + ((BidAggregate)aggregate).getBidScopePropertyCode(); %>
    <bean:message key=”<%=scopeKey%>”/>  </td>
    </logic:present>
    <td align=”left” valign=”top”>
    <logic:notEmpty name=”aggregate” property=”bids”>
    <table border=”0″ cellspacing=”0″ cellpadding=”0″>
    <logic:iterate id=”bid” name=”aggregate” property=”bids”>
    <tr class=”nonParticipatingBids”><td align=”left” valign=”top”><bean:message name=”bid” property=”desireResName”/> <bean:write name=”bid” property=”bidFormatted”/></td></tr>
    </logic:iterate>
    </table>
    </logic:notEmpty>
    </td></tr>
    </logic:equal>
    </logic:iterate>
    <% if (!nonPart) { %>
    <bean:message key=”analyzer.nonParticipatingBids.none”/>
    <% } %>
    </table>
    </td></tr>
    </table><hr>
    <%– The task list –%>
    <b><bean:message key=”analyzer.header”/></b><br><br>
    <table width=”100%” border=”1″ cellspacing=”0″ cellpadding=”5″>
    <tr class=”title3″><td><a href=”javascript:sortColumn(<%=AnalyzerTripListItem.SORT_BY_NAME%>)”>
    <bean:message key=”analyzer.header.taskName”/>
    </a></td><td><a href=”javascript:sortColumn(<%=AnalyzerTripListItem.SORT_BY_DATE%>)”>
    <bean:message key=”analyzer.header.startDate”/>
    </a></td>
    <tiles:insert page=”/analyzerTripListHeaderCustom.jsp” flush=”false” />
    <td><a href=”javascript:sortColumn(<%=AnalyzerTripListItem.SORT_BY_CONFLICT%>)”>
    <bean:message key=”analyzer.header.conflict”/>
    </a></td><td><a href=”javascript:sortColumn(<%=AnalyzerTripListItem.SORT_BY_SCORE%>)”>
    <bean:message key=”analyzer.header.score”/>
    </a></td></tr>
    <logic:iterate id=”tripItem” name=”taskList”>
    <bean:define id=”item” name=”tripItem” toScope=”request”/>
    <logic:equal name=”tripItem” property=”hidden” value=”false”>
    <tr><td class=”smaller”><a href=”javascript:showDetails(<bean:write name=”tripItem” property=”id”/>)”>
    <bean:write name=”tripItem” property=”name”/>
    </a></td><td class=”smaller” align=”center”>
    <bean:write name=”tripItem” property=”startDate” formatKey=”display.date.format.analyzerTaskList”/>
    </td>
    <tiles:insert page=”/analyzerTripListCellCustom.jsp” flush=”false”/>
    <td class=”smaller” align=”center”>
    <logic:equal name=”tripItem” property=”conflict” value=”true”>X</logic:equal>
    <logic:equal name=”tripItem” property=”conflict” value=”false”> </logic:equal>
    </td><td class=”smaller” align=”right”>
    <% if (((AnalyzerTripListItem)tripItem).getReserveDownTo() < 0) { %>
    <logic:notEqual name=”activeSession” property=”currentAutoBidMode” value=”true”>
    <bean:write name=”tripItem” property=”score” format=”0.0″/>
    </logic:notEqual>
    <logic:equal name=”activeSession” property=”currentAutoBidMode” value=”true”>
    <bean:message name=”tripItem” property=”autoWeightScoreResName”/>
    </logic:equal>
    <% } else { %>
    Rsv <% if (((AnalyzerTripListItem)tripItem).getReserveDownTo() == BidAggregate.RESERVE_DOWN_TO_ANY) { %><bean:message key=”bidaggregate.conditional.any”/>
    <% } else { %><%=((AnalyzerTripListItem)tripItem).getReserveDownToDisplay()%><% } %>
    <% } %></td></tr>
    </logic:equal>
    </logic:iterate>
    </table>
    <!– For fractional display ——–>
    <% if (!firstIndex.equals(“-1”) || !lastIndex.equals(“-1″)) { %>
    <table>
    <tr>
    <!– the First Page button –>
    <td align=”center”>
    <input type=”button” name=”pager” value=”<bean:message key=”analyzer.section.first”/> <%=ApplicationContainer.baPageTripListSize%>”
    onclick=”displaySection(<%=Constants.ANALYZER_FIRST_PAGE%>)”/>
    </td>
    <!– the Previous button –>
    <td align=”center”>
    <% if (!firstIndex.equals(“0”) && !firstIndex.equals(“-1″)) { %>
    <input type=”button” name=”pager” value=”<bean:message key=”analyzer.section.previous”/>”
    onclick=”displaySection(<%=Constants.ANALYZER_PREVIOUS_PAGE%>)”/>
    <% } %>
    </td>
    <!– the Next button –>
    <td align=”center”>
    <% if (!lastIndex.equals(“-1″)) { %>
    <input type=”button” name=”pager” value=”<bean:message key=”analyzer.section.next”/>”
    onclick=”displaySection(<%=Constants.ANALYZER_NEXT_PAGE%>)”/>
    <% } %>
    </td>
    <!– the Last Page button –>
    <td align=”center”>
    <input type=”button” name=”pager” value=”<bean:message key=”analyzer.section.last”/> <%=ApplicationContainer.baPageTripListSize%>”
    onclick=”displaySection(<%=Constants.ANALYZER_LAST_PAGE%>)”/>
    </td>
    </tr>
    </table>
    <% }%>
    <!———————————->
    </logic:notEmpty>
    <logic:empty name=”taskList”>
    <p class=”normal”>
    <logic:empty name=”analysisNotFinished”>
    <% if (continueToPull) { %>
    <bean:message key=”analyzer.message.dontpress”/>
    <% } else { %>
    <bean:message key=”warning.emptyAnalyzerTripList”/>
    <% } %>
    </logic:empty>
    <logic:notEmpty name=”analysisNotFinished”>
    <logic:empty name=”analyzingTicketNumber”>
    <% Integer count = (Integer)request.getAttribute(“analysisNotFinished”); %>
    <% int msgCount = 0; %>
    <% if (count != null) msgCount = count.intValue(); %>
    <% while (msgCount– > 0) { %>
    <bean:message key=”analyzer.message.wait.long”/><br>
    <% } %>
    </logic:empty>
    <logic:notEmpty name=”analyzingTicketNumber”>
    <logic:notEmpty name=”userTicketNumber”>
    <bean:message key=”analyzer.message.client”/> <br> <bean:write name=”userTicketNumber”/>. <br>
    <bean:message key=”analyzer.message.serving”/> <br><bean:write name=”analyzingTicketNumber”/>. <br>
    </logic:notEmpty>
    <% Integer count = (Integer)request.getAttribute(“analysisNotFinished”); %>
    <% int msgCount = 0; %>
    <% if (count != null) msgCount = count.intValue(); %>
    <% while (msgCount– > 0) { %>
    <bean:message key=”analyzer.message.wait”/><br>
    <% } %>
    </logic:notEmpty>
    </logic:notEmpty>
    <logic:notEmpty name=”analysisErrorOccurred”>
    <bean:message key=”analyzer.message.error”/>
    </logic:notEmpty>
    </p>
    </logic:empty>
    </body>
    </html>

    #222631 Reply

    Riyad Kalla
    Member

    TIP: If you are posting code, try using the “code” buttons to insert code markup around your code so it maintains it’s format.

    That error usually occurs when there is heavy use of includes breaking pieces of the opening and closing tags across multiple files… does this occur in your file? (I can’t read it the way it is). If you are able to extract that file and create a small sample project that you can File > Export > ZIP and email to us at support@genuitec.com then we would be happy to look at it and see what is going on. But make sure the project is valid such that we can build it without errors and see the problem you are seeing.

    #222642 Reply

    mkong
    Member

    Thanks for the prompt response, Riyad.

    In that JSP there are a few tiles:insert but the
    inserted pages are empty or almost empty.

    There are a lot of “nested” <logic> tags in that JSP, such as –

    <logic:empty>
     <logic:equal>....
       <logic:equal>....
         <logic:empty>...</logic:empty>
       </logic:equal>
       <logic:notEqual>...</logic:notEqual>
     </logic:equal>
     <logic:notEqual>...
       </logic:equal>...</logic:equal>
     <logic:notEqual> ...
    </logic:empty>
    ...

    Although quite complicated to trace, the tags are all balanced.

    But, could the fact that they are so “nested” make the JSP validation fail?

    Thanks.

    #222651 Reply

    Riyad Kalla
    Member

    But, could the fact that they are so “nested” make the JSP validation fail?

    Not likely, the validation we run on the JSP pages uses the Jasper2 compiler which is the same that Tomcat 5.x uses; so if this page is running within Tomcat, we should show it as valid. Is this error shown in the left margin or right margin of the editor? Are you able to create a sample project that exhibits this problem and email it so us? If so we might be able to get a fix into 3.8.4 for you, no promises just yet…

Viewing 4 posts - 1 through 4 (of 4 total)
Reply To: v3.8.3 inexplicable JSP validation error

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