0

So i have a jsp that serves a nomination view and form depending on variables passed through spring mvc. Now the view works when the user wants to fill out a new nomination. It also works when they are viewing the nomination for review (where it is flagged as disabled) but it doesn't work a reviewer (called generalist in this case) access it. It breaks up to this point:

view

notice where it starts displaying html code. The code display happens in IE, but on the other browsers it doesn't yet still "breaks" because it's missing form elements on the side and bottom.

This only happens with this snippet:

<div align="center">
    <c:if test="${mode==cons.GENERALIST}">
        <spring:message code="common.status"/>: <br/>
        <select name="statusId">
            <c:forEach items="${statusList}" var="status">
                <option value="${status.id}" <c:if
                        test="${status.id==currentStatusId}"> selected="selected"</c:if> >
                    <c:if test="${lang=='es'}">${status.statusSpanish}</c:if>
                    <c:if test="${lang=='en'}">${status.statusEnglish}</c:if>
                </option>
            </c:forEach>
        </select>
        <br/>
        <br/>

        <spring:message code="common.comments"/>:<br/>
        <textarea name="generalistComment" cols="50" rows="5">${currentGeneralistComment}</textarea>
        <br/>
        <br/>
        <spring:message code="common.committeeScore"/>:<br/>
        <input type="text" name="committeeScore" value="${nomination.commiteeScore}"/>
    </c:if>
</div>

The full JSP code is here: *please note that I am using a javascript function to access the other form's inputs and this works on other nomination views so that's clearly not it *second note: this is part of a spring tile, so you won't find html, head or body tags here.

<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib uri="http://www.springframework.org/tags" prefix="spring" %>
<jsp:useBean id="cons" class="com.project.lmu.util.NominationMode" scope="application"/>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %>

<script type="text/javascript">
    $(function() {
        $('.datepicker').datepicker({
            changeMonth: true,
            changeYear:  true,
            minDate:     "-50Y",
            maxDate:    new Date(),
            yearRange:  "-50",
            showOn: "button",
            buttonImage: "images/prototipo/calendar1.png",
            buttonImageOnly: true
        });
    });
</script>

<td id="content_inner">
<div id="content">

<h1><spring:message code="successNomination.lable.title"/></h1>
<br/>

<c:if test="${error==true}">

    <div class="error">
        <ul>
            <c:forEach items="${nomination.errors}" var="message">
                <li><spring:message code="${message}"/></li>
            </c:forEach>
        </ul>
    </div>
</c:if>

<form name="f" action="successSaveNomination" method="post">

<c:if test="${nomination.nominationId==null}">
    <input type="hidden" name="nominationId" value="0"/>
</c:if>
<c:if test="${nomination.nominationId!=null}">
    <input type="hidden" name="nominationId" value="${nomination.nominationId}"/>
</c:if>

<input type="hidden" name="nomineeId" value="${nominee.id}"/>
<input type="hidden" name="mode" value="${mode}"/>

<table border="0" cellpadding="0" cellspacing="5" width="100%">
    <tr>
        <td valign="top" width="150px"><b><spring:message code="successNomination.lable.subtitle1"/>: </b></td>
        <td>
            <table border="0" cellpadding="0" cellspacing="0" width="100%">
                <tr>
                    <td>${nominee.firstName} ${nominee.middleName} ${nominee.lastName}</td>
                </tr>
                <tr>
                    <td><i>${nominee.jobTitle} - ${nominee.department.description} - ${nominee.id}</i></td>
                </tr>
            </table>
        </td>
    </tr>
    <tr>
        <td><b><spring:message code="successNomination.lable.subtitle4"/>: </b></td>
        <td>
            <select name="periodId"
                    <c:if test="${mode==cons.READ_ONLY||mode==cons.GENERALIST}">disabled="disabled" </c:if> >
                <c:forEach items="${periods}" var="period">
                    <option value="${period.id}"
                            <c:if test="${period.id==nomination.periodId}">selected="selected"</c:if>>&nbsp; &nbsp;
                        &nbsp; &nbsp;${period.periodDescription}</option>
                </c:forEach>
            </select>
        </td>
    </tr>
</table>

<br/>

<table width="100%">
<tr>
    <th class="green"><spring:message code="successNomination.label.requirements.title1"/></th>
    <th width="50%" class="green"><spring:message code="successNomination.label.requirements.title2"/></th>
</tr>
<tr>
    <td class="gborder" valign="middle">
        <p><spring:message code="successNomination.label.requirements1"/></p>

        <p>
            <spring:message code="successNomination.label.requirements2"/>:
            <input type="text" class="points" disabled="disabled"
                   value="<fmt:formatDate type='date' pattern='MM/dd/yyyy' value='${nominee.hireDate}' />"/>
        </p>
    </td>
    <td class="gborder">
        <p class="centered">
            <textarea cols="40" rows="6" name="hireComments" <c:if
                    test="${mode==cons.READ_ONLY||mode==cons.GENERALIST}"> disabled="disabled" </c:if>>${nomination.hireComments}</textarea>
        </p>
    </td>
</tr>
<tr>
    <td class="gborder"><p><spring:message code="successNomination.label.requirements3"/><br/>
        <a href="#footnote" class="required"><spring:message code="successNomination.lable.instructions1"/> </a></p>

        <table>
            <tr style="padding:3em;">
                <td><spring:message code="successNomination.label.requirements4"/>:</td>
                <td><input type="text" class="points" name="evaluationPoints1"
                           value="${nomination.evaluationPoints1}"
                           <c:if test="${mode==cons.READ_ONLY||mode==cons.GENERALIST}">disabled="disabled"</c:if> />
                </td>
                <td><spring:message code="successNomination.label.requirements5"/>:</td>
                <td><input type="text" class="points datepicker" name="evaluationYear1"
                           value="${nomination.evaluationYear1}"
                           <c:if test="${mode==cons.READ_ONLY||mode==cons.GENERALIST}">disabled="disabled"</c:if>
                           readonly="readonly"/>
                </td>

            </tr>
            <tr>
                <td><spring:message code="successNomination.label.requirements4"/>:</td>
                <td><input type="text" class="points" name="evaluationPoints2"
                           value="${nomination.evaluationPoints2}"
                           <c:if test="${mode==cons.READ_ONLY||mode==cons.GENERALIST}">disabled="disabled"</c:if> />
                </td>
                <td><spring:message code="successNomination.label.requirements5"/>:</td>
                <td><input type="text" class="points datepicker" name="evaluationYear2"
                           value="${nomination.evaluationYear2}"
                           <c:if test="${mode==cons.READ_ONLY||mode==cons.GENERALIST}">disabled="disabled"</c:if>
                           readonly="readonly"/>
                </td>
            </tr>
        </table>
    </td>
    <td class="gborder">
        <p class="centered">
            <textarea cols="40" rows="6" name="evaluationComments"
                    <c:if test="${mode==cons.READ_ONLY||mode==cons.GENERALIST}"> disabled="disabled" </c:if>>${nomination.evaluationComments}</textarea>
        </p>
    </td>
</tr>
<tr>
    <td class="gborder"><p><spring:message code="successNomination.label.requirements6"/></p>

        <table>
            <tr>
                <td><spring:message code="successNomination.label.requirements7"/>:</td>
                <td>
                    <input type="text" class="points datepicker" name="promotionDate1"
                           <c:if test="${nomination.promotionDate1 != null}">value="${nomination.promotionDate1}"</c:if>
                           <c:if test="${mode==cons.READ_ONLY||mode==cons.GENERALIST}">disabled="disabled"</c:if>
                           readonly="readonly"/>
                </td>
            </tr>
            <tr>
                <td><spring:message code="successNomination.label.requirements7"/>:</td>
                <td>
                    <input type="text" class="points datepicker" name="promotionDate2"
                           <c:if test="${nomination.promotionDate2 != null}">value="${nomination.promotionDate2}"</c:if>
                           <c:if test="${mode==cons.READ_ONLY||mode==cons.GENERALIST}">disabled="disabled"</c:if>
                           readonly="readonly"/>
                </td>
            </tr>
            <tr>
                <td><spring:message code="successNomination.label.requirements7"/>:</td>
                <td>
                    <input type="text" class="points datepicker" name="promotionDate3"
                           <c:if test="${nomination.promotionDate3 != null}">value="${nomination.promotionDate3}"</c:if>
                           <c:if test="${mode==cons.READ_ONLY||mode==cons.GENERALIST}">disabled="disabled"</c:if>
                           readonly="readonly"/>
                </td>
            </tr>
            <tr>
                <td><spring:message code="successNomination.label.requirements7"/>:</td>
                <td>
                    <input type="text" class="points datepicker" name="promotionDate4"
                           <c:if test="${nomination.promotionDate4 != null}">value="${nomination.promotionDate4}"</c:if>
                           <c:if test="${mode==cons.READ_ONLY||mode==cons.GENERALIST}">disabled="disabled"</c:if>
                           readonly="readonly"/>
                </td>
            </tr>
        </table>
    </td>
    <td class="gborder">
        <p class="centered">
            <textarea cols="40" rows="6" name="promotionComments"
                    <c:if test="${mode==cons.READ_ONLY||mode==cons.GENERALIST}"> disabled="disabled" </c:if>>${nomination.promotionComments}</textarea>
        </p>
    </td>
</tr>
<tr>
    <td class="gborder">
        <p>
            <spring:message code="successNomination.label.requirements8"/><br/>
            <a href="#footnote" class="required"><spring:message code="successNomination.lable.instructions1"/></a>
        </p>

        <p>

            <input type="radio" name="extraContribution" value="1"
                   <c:if test="${nomination.extraContribution == true}">checked="checked"</c:if>
                   <c:if test="${mode==cons.READ_ONLY||mode==cons.GENERALIST}">disabled="disabled"</c:if>
                   onclick="activateContributionsField(document.f)"/>
            <spring:message code="successNomination.label.requirements9"/> &nbsp;
            <input type="radio" name="extraContribution" value="0"
                   <c:if test="${nomination.extraContribution == false}">checked="checked"</c:if>
                   <c:if test="${mode==cons.READ_ONLY||mode==cons.GENERALIST}">disabled="disabled"</c:if>
                   onclick="activateContributionsField(document.f)"/>
            <spring:message code="successNomination.label.requirements10"/><br/>
            <spring:message code="successNomination.label.requirements11"/>:
            <input type="text" class="points" name="extraContributionPoints"
                   value="${nomination.extraContributionPoints}"
                   <c:if test="${mode==cons.READ_ONLY||mode==cons.GENERALIST || nomination.extraContribution!=true}">disabled="disabled"</c:if> />
        </p>
    </td>
    <td class="gborder">
        <p class="centered">
            <textarea cols="40" rows="6" name="extraComments"
                    <c:if test="${mode==cons.READ_ONLY||mode==cons.GENERALIST}"> disabled="disabled" </c:if>>${nomination.extraComments}</textarea>
        </p>
    </td>
</tr>
<tr>
    <td class="gborder">
        <p><spring:message code="successNomination.label.requirements12"/><br/>
            <a href="#footnote" class="required"><spring:message code="successNomination.lable.instructions1"/></a>
        </p>

        <p>
            <input type="radio" name="companyPolicy" value="1"
                   <c:if test="${nomination.companyPolicy == true}">checked="checked"</c:if>
                   <c:if test="${mode==cons.READ_ONLY||mode==cons.GENERALIST}">disabled="disabled"</c:if> />
            <spring:message code="successNomination.label.requirements9"/> &nbsp;
            <input type="radio" name="companyPolicy" value="0"
                   <c:if test="${nomination.companyPolicy == false}">checked="checked"</c:if>
                   <c:if test="${mode==cons.READ_ONLY||mode==cons.GENERALIST}">disabled="disabled"</c:if> />
            <spring:message code="successNomination.label.requirements10"/>
        </p>
    </td>
    <td class="gborder">
        <p class="centered">
            <textarea cols="40" rows="6" name="companyPolicyComments"
                    <c:if test="${mode==cons.READ_ONLY||mode==cons.GENERALIST}"> disabled="disabled" </c:if>>${nomination.companyPolicyComments}</textarea>
        </p>
    </td>
</tr>
<tr>
    <td class="gborder">
        <p>
            <spring:message code="successNomination.label.requirements13"/><br/>
            <a href="#footnote" class="required"><spring:message code="successNomination.lable.instructions1"/></a>
        </p>

        <p>
            <spring:message code="successNomination.label.requirements14"/>:
            <input type="radio" value="1" name="evaluationAttendancePolicy1"
                   <c:if test="${nomination.evaluationAttendancePolicy1 == true}">checked="checked"</c:if>
                   <c:if test="${mode==cons.READ_ONLY||mode==cons.GENERALIST}">disabled="disabled"</c:if> />
            <spring:message code="successNomination.label.requirements9"/>
            <input type="radio" value="0" name="evaluationAttendancePolicy1"
                   <c:if test="${nomination.evaluationAttendancePolicy1 == false}">checked="checked"</c:if>
                   <c:if test="${mode==cons.READ_ONLY||mode==cons.GENERALIST}">disabled="disabled"</c:if> />
            <spring:message code="successNomination.label.requirements10"/>
        </p>

        <p>
            <spring:message code="successNomination.label.requirements15"/>:
            <input type="radio" value="1" name="evaluationAttendancePolicy2"
                   <c:if test="${nomination.evaluationAttendancePolicy2 == true}">checked="checked"</c:if>
                   <c:if test="${mode==cons.READ_ONLY||mode==cons.GENERALIST}">disabled="disabled"</c:if> />
            <spring:message code="successNomination.label.requirements9"/>
            <input type="radio" value="0" name="evaluationAttendancePolicy2"
                   <c:if test="${nomination.evaluationAttendancePolicy2 == false}">checked="checked"</c:if>
                   <c:if test="${mode==cons.READ_ONLY||mode==cons.GENERALIST}">disabled="disabled"</c:if> />
            <spring:message code="successNomination.label.requirements10"/>
        </p>
    </td>
    <td class="gborder">
        <p class="centered">
            <textarea cols="40" rows="6" name="attendanceComments"
                    <c:if test="${mode==cons.READ_ONLY||mode==cons.GENERALIST}"> disabled="disabled" </c:if>>${nomination.attendanceComments}</textarea>
        </p>
    </td>
</tr>
</table>

<br/>

<p>
    <spring:message code="successNomination.label.requirements16"/>:
</p>

<div align="center">
    <textarea cols="50" rows="7" name="reason" <c:if
            test="${mode==cons.READ_ONLY||mode==cons.GENERALIST}"> disabled="disabled" </c:if> >${nomination.reason}</textarea>
</div>
<br/>

<div align="center">
    <c:if test="${mode==cons.GENERALIST}">
        <spring:message code="common.status"/>: <br/>
        <select name="statusId">
            <c:forEach items="${statusList}" var="status">
                <option value="${status.id}" <c:if
                        test="${status.id==currentStatusId}"> selected="selected"</c:if> >
                    <c:if test="${lang=='es'}">${status.statusSpanish}</c:if>
                    <c:if test="${lang=='en'}">${status.statusEnglish}</c:if>
                </option>
            </c:forEach>
        </select>
        <br/>
        <br/>

        <spring:message code="common.comments"/>:<br/>
        <textarea name="generalistComment" cols="50" rows="5">${currentGeneralistComment}</textarea>
        <br/>
        <br/>
        <spring:message code="common.committeeScore"/>:<br/>
        <input type="text" name="committeeScore" value="${nomination.commiteeScore}"/>
    </c:if>
</div>


<div id="bottommenu">
    <c:if test="${(mode==cons.NEW||mode==cons.EDIT)}">
        <input type="submit" value="<spring:message code="common.send"/>"/>
    </c:if>
    <c:if test="${mode==cons.GENERALIST}">
        <input type="button" value="<spring:message code="common.save"/>" onclick="generalistSuccessUpdate()"/>
    </c:if>
    <c:if test="${mode==cons.NEW}">
        <input type="reset" value="<spring:message code="common.reset"/>">
    </c:if>
    <c:if test="${mode==cons.EDIT}">
        <script type="text/javascript">var msg = "<spring:message code='nominations.confirm' javaScriptEscape='true' />";</script>
        <input type="button" value="<spring:message code="common.delete"/>" onclick="delNomination()"/>
    </c:if>
    <c:if test="${mode==cons.READ_ONLY||mode==cons.EDIT||mode==cons.GENERALIST}">
        <input type="button" value="<spring:message code="common.print"/>" onclick="printNomination()"/>
        <input type="button" value="<spring:message code="common.back"/>" onclick="history.back();"/>
    </c:if>
</div>

<div id="footnote">
    <p> * <spring:message code="successNomination.lable.instructions3"/>.<br/>
        **<spring:message code="successNomination.lable.instructions4"/>.</p>
</div>

</form>

<form name="d" action="successDeleteNomination" method="post">
    <input type="hidden" name="nominationId" value="${nomination.nominationId}"/>
</form>

<form name="p" action="successPrint" method="post">
    <input type="hidden" name="nominationId" value="${nomination.nominationId}"/>
</form>

<form name="g" action="successGenUpdate" method="post">
    <input type="hidden" name="nominationId" value="${nomination.nominationId}"/>
    <input type="hidden" name="statusId" value="${statusId}"/>
    <input type="hidden" name="generalistComment" value="${generalistComment}"/>
</form>

</div>
</td>

So what exactly is breaking my html here? I know it's the snippet, but I've looked for unclosed tags without avail.

4

0 回答 0