Remove file upload handling from example for Spring MVC form taglib

This commit is contained in:
David Morley 2016-03-07 05:33:20 -06:00
parent c0ffd1e4bf
commit 365ec16879
4 changed files with 2 additions and 30 deletions

View File

@ -24,12 +24,5 @@
<bean class="org.springframework.context.support.ResourceBundleMessageSource" id="messageSource">
<property name="basename" value="messages" />
</bean>
<!-- <bean id="multipartResolver"
class="org.springframework.web.multipart.commons.CommonsMultipartResolver" /> -->
<bean id="multipartResolver"
class="org.springframework.web.multipart.support.StandardServletMultipartResolver">
</bean>
</beans>

View File

@ -22,9 +22,9 @@
<body>
<h3>Welcome, Enter The Person Details</h3>
<h3>Welcome, Enter the Person Details</h3>
<form:form method="POST" action="addPerson" modelAttribute="person" enctype="multipart/form-data">
<form:form method="POST" action="addPerson" modelAttribute="person">
<form:errors path="*" cssClass="errorbox" element="div" />
@ -104,10 +104,6 @@
<td><form:label path="notes">Notes</form:label></td>
<td><form:textarea path="notes" rows="3" cols="20"/></td>
</tr>
<tr>
<td><form:label path="file">Select a file to upload</form:label></td>
<td><input type="file" name="file" /></td>
</tr>
<tr>
<td><form:hidden path="id" value="12345"/></td>
</tr>

View File

@ -62,19 +62,5 @@
</tr>
</table>
<h2>Submitted File</h2>
<table>
<tr>
<td>OriginalFileName :</td>
<td>${person.file.originalFilename}</td>
</tr>
<tr>
<td>Type :</td>
<td>${person.file.contentType}</td>
</tr>
</table>
</body>
</html>

View File

@ -28,9 +28,6 @@
<servlet-name>mvc</servlet-name>
<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
<load-on-startup>1</load-on-startup>
<multipart-config>
<location>/tmp</location>
</multipart-config>
</servlet>
<servlet-mapping>
<servlet-name>mvc</servlet-name>