Skip to content

Commit 365ec16

Browse files
committed
Remove file upload handling from example for Spring MVC form taglib
1 parent c0ffd1e commit 365ec16

4 files changed

Lines changed: 2 additions & 30 deletions

File tree

‎spring-mvc-xml/src/main/resources/webMvcConfig.xml‎

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,5 @@
2424
<bean class="org.springframework.context.support.ResourceBundleMessageSource" id="messageSource">
2525
<property name="basename" value="messages" />
2626
</bean>
27-
28-
<!-- <bean id="multipartResolver"
29-
class="org.springframework.web.multipart.commons.CommonsMultipartResolver" /> -->
30-
31-
<bean id="multipartResolver"
32-
class="org.springframework.web.multipart.support.StandardServletMultipartResolver">
33-
</bean>
3427

3528
</beans>

‎spring-mvc-xml/src/main/webapp/WEB-INF/view/personForm.jsp‎

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,9 @@
2222

2323
<body>
2424

25-
<h3>Welcome, Enter The Person Details</h3>
25+
<h3>Welcome, Enter the Person Details</h3>
2626

27-
<form:form method="POST" action="addPerson" modelAttribute="person" enctype="multipart/form-data">
27+
<form:form method="POST" action="addPerson" modelAttribute="person">
2828

2929
<form:errors path="*" cssClass="errorbox" element="div" />
3030

@@ -104,10 +104,6 @@
104104
<td><form:label path="notes">Notes</form:label></td>
105105
<td><form:textarea path="notes" rows="3" cols="20"/></td>
106106
</tr>
107-
<tr>
108-
<td><form:label path="file">Select a file to upload</form:label></td>
109-
<td><input type="file" name="file" /></td>
110-
</tr>
111107
<tr>
112108
<td><form:hidden path="id" value="12345"/></td>
113109
</tr>

‎spring-mvc-xml/src/main/webapp/WEB-INF/view/personView.jsp‎

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -62,19 +62,5 @@
6262
</tr>
6363
</table>
6464

65-
<h2>Submitted File</h2>
66-
<table>
67-
68-
<tr>
69-
<td>OriginalFileName :</td>
70-
<td>${person.file.originalFilename}</td>
71-
</tr>
72-
73-
<tr>
74-
<td>Type :</td>
75-
<td>${person.file.contentType}</td>
76-
</tr>
77-
78-
</table>
7965
</body>
8066
</html>

‎spring-mvc-xml/src/main/webapp/WEB-INF/web.xml‎

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,6 @@
2828
<servlet-name>mvc</servlet-name>
2929
<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
3030
<load-on-startup>1</load-on-startup>
31-
<multipart-config>
32-
<location>/tmp</location>
33-
</multipart-config>
3431
</servlet>
3532
<servlet-mapping>
3633
<servlet-name>mvc</servlet-name>

0 commit comments

Comments
 (0)