Thanks for moving it in the right queue.
Please find the
JSP and my action class below
<html:form method="POST" action="UploadManualPostingsFilesAction.do" enctype="multipart/form-data" >
<-- some other code here--->
<tr>
<td class="formLabel"><font size="2" color="#0a82c1" align="center"> Posting File for Upload </font><font color="red"> *</td>
<td> <html:file property="theFile"/></td>
</tr>
<!-- Submitting the form -->
I am trying to retreive the file content
Action class:
protected ActionForward process(HttpServletRequest request,
HttpServletResponse response, ActionMapping mapping, ActionForm form)
{
if(request.getParameter("doActionFlag")!=null)
{
if(request.getParameter("doActionFlag").equalsIgnoreCase("UPLOADFILE"))
{
UploadManualPostingsFilesForm uploadManualPostingsFilesForm =(UploadManualPostingsFilesForm)form;
FormFile inputFile = uploadManualPostingsFilesForm.getTheFile();
// I read the file and update the database.
InputStream input = inputFile.getInputStream();
BufferedReader in = new BufferedReader(new InputStreamReader(input));
int failedRecordsCounter = 0;
while ((str = in.readLine()) != null)
{
// perform DB operation
}
DB operation is successfull, while trying to return to the JSP i get this exception..I am really new to Struts and file uploading i am doing for the first time.. I searched for this exception in the net..everyone asked the same question..i am not able to find the answer.