Skip to content

Commit 09d9cf2

Browse files
committed
Add form tag example
1 parent 9085362 commit 09d9cf2

3 files changed

Lines changed: 10 additions & 4 deletions

File tree

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
NotEmpty.person.name = Name is required!
1+
required.name = Name is required!
22
NotEmpty.person.password = Password is required!

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

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,12 @@
1212
color: #ff0000;
1313
}
1414
15+
.errorbox {
16+
17+
background-color: #ffEEEE;
18+
border: 2px solid #ff0000;
19+
}
20+
1521
</style>
1622

1723
<body>
@@ -20,13 +26,13 @@
2026

2127
<form:form method="POST" action="/spring-mvc-xml/addPerson" modelAttribute="person" enctype="multipart/form-data">
2228

23-
<form:errors path="*" cssClass="error"/>
29+
<form:errors path="*" cssClass="errorbox" element="div" />
2430

2531
<table>
2632
<tr>
2733
<td><form:label path="name">Name</form:label></td>
2834
<td><form:input path="name" /></td>
29-
<td><form:errors path="name" cssClass="error" /></td>
35+
<td><form:errors path="name" cssClass="error" element="div"/></td>
3036
</tr>
3137
<tr>
3238
<td><form:label path="email">E-mail</form:label></td>

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
3030
<load-on-startup>1</load-on-startup>
3131
<multipart-config>
32-
<location>C:/Users/ivan/Desktop/tmp</location>
32+
<location>/tmp</location>
3333
</multipart-config>
3434
</servlet>
3535
<servlet-mapping>

0 commit comments

Comments
 (0)