I have page in which I am uploading one Excel file. If it has errors, I display those errors in a tabular format using display tag.
Everything works fine until the displaying. But if I have to sort or export the data then it stops working again and it redirects to same page without any data.
I guess for every action (like sort and export) it is hitting the database and hence at the next request it is not showing any data because it is not getting the file name.
Can anybody explain if I am right or wrong? I am new to this display tag.
Here is my JSP src code:
</head>
<body>
<form:form id="formAdd" method="post" action="locationSave.do"
commandName="location">
<form:hidden path="id" />
<form:hidden path="isDeleted" />
<form:hidden path="remarks" />
<form:hidden path="status" />
<form:hidden path="updatedDt" />
<input type="hidden" value="${locationCodes}" id="codes">
<table style="width: 1000px; border:0; cellspacing:1; cellpadding=0; class=table_border; align :center;">
<tr>
<td colspan="6" class ="H1">
Location Master
</td>
</tr>
<tr>
<td colspan="6" class="H2">
Add Location
</td>
</tr>
<tr>
<td style="width: 16%;" class ="tdheader_left"><form:label path="code">
<spring:message code="label.loccode" />
</form:label></td>
<td style="width: 16%;" class="tdheader_textbox"><form:input
path="code" accesskey="o" cssClass="input" size="7" maxlength="5"
id="code" /></td>
<td style="width: 16%;" class ="tdheader_left"><form:label path="name">
<spring:message code="label.locname" />
</form:label></td>
<td style="width: 16%;" class="tdheader_textbox"><form:input
path="name" accesskey="n" class="input" maxlength="20" size="25"
id="name" /></td>
<td style="width: 16%;" class ="tdheader_left"><form:label path="locGrp">
<spring:message code="label.locGrp" />
</form:label></td>
<td style="width: 16%;" class="tdheader_dropdown"><form:select accesskey="g"
path="locGrp.id" class="input" id="grpId">
<form:option value="-1" label="--- Select ---" />
<form:options items="${locGrp}" />
</form:select></td>
</tr>
<tr>
<td colspan="6" align="center" class="H1">
<input id="save" accesskey="s" type="submit" value="Save"/>
<input id="reset" accesskey="r" type="reset" value="Reset" />
<input type="button" accesskey="c" value="Cancel" onclick="window.location = 'location.do';" />
<input type="button" id="upload_file"
accesskey="a" value="Upload File"
/></td>
</tr>
</table>
</form:form>
<div id="formUpload" style="text-align:center;display:block;">
<form:form id="formFile" method="post" action="locationFileUpload.do" commandName="file" enctype="multipart/form-data">
Please select a file to upload : <input type="file" name="file" />
<input type="submit" value="upload" id="success" />
<c:if test="${locErrorList != null}">
<div id="uploaderror">
Following locations could not be uploaded
<display:table uid="2" name="locErrorList" class="displaytag" id="locError" pagesize="10" excludedParams="*" requestURIcontext="true"
defaultorder="ascending" requestURI="locationFileUpload.do" export="true" >
<display:column property="code" sortable="true" title="Location Code" headerClass="sortable" />
<display:column property="name" sortable="true" title="Location Name" headerClass="sortable" />
<display:column property="error" sortable="true" title="Reason For Failure" headerClass="sortable" />
</display:table>
</div>
</c:if>
</form:form>
</div>
</body>
</html>