Add form tag example

This commit is contained in:
Ivan 2016-03-02 14:57:33 +01:00
parent 90853626d2
commit 09d9cf26b4
3 changed files with 10 additions and 4 deletions

View File

@ -1,2 +1,2 @@
NotEmpty.person.name = Name is required!
required.name = Name is required!
NotEmpty.person.password = Password is required!

View File

@ -12,6 +12,12 @@
color: #ff0000;
}
.errorbox {
background-color: #ffEEEE;
border: 2px solid #ff0000;
}
</style>
<body>
@ -20,13 +26,13 @@
<form:form method="POST" action="/spring-mvc-xml/addPerson" modelAttribute="person" enctype="multipart/form-data">
<form:errors path="*" cssClass="error"/>
<form:errors path="*" cssClass="errorbox" element="div" />
<table>
<tr>
<td><form:label path="name">Name</form:label></td>
<td><form:input path="name" /></td>
<td><form:errors path="name" cssClass="error" /></td>
<td><form:errors path="name" cssClass="error" element="div"/></td>
</tr>
<tr>
<td><form:label path="email">E-mail</form:label></td>

View File

@ -29,7 +29,7 @@
<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
<load-on-startup>1</load-on-startup>
<multipart-config>
<location>C:/Users/ivan/Desktop/tmp</location>
<location>/tmp</location>
</multipart-config>
</servlet>
<servlet-mapping>