1
양식을 제출하는 동안 양식을 제출하는 동안 필드 및 파일 업로드 요소를 포함하는 양식이 있습니다. 양식 개체를 기록 할 때 모든 필드가 null이되고 양식을 제거 할 때 enctype="multipart/form-data"1
그럼 모든 필드를 얻을 파일 개체가 null이지고있다.필드 및 파일 업로드
양식 코드 :
<form:form method="post" id="form" name="frm" action="${action}" enctype="multipart/form-data">
<table>
<tr>
<td><form:label path="productName">Product Name: </form:label></td>
<td>
<form:input path="productName"/>
</td>
</tr>
<tr>
<td><form:label path="rfile">Receipt File</form:label></td>
<td><form:input path="rfile" id="receiptFile" type="file" /></td>
</tr>
<tr>
<td colspan="2"><input type="submit" value="Upload Receipt" /></td>
</tr>
</table>
</form:form>
컨트롤러 코드 : 클라이언트의 요청을 구문 분석 CommonsMultipartFile
예제 코드가 도움이 될 것입니다. –