Add form tag example
This commit is contained in:
parent
90853626d2
commit
09d9cf26b4
|
@ -1,2 +1,2 @@
|
||||||
NotEmpty.person.name = Name is required!
|
required.name = Name is required!
|
||||||
NotEmpty.person.password = Password is required!
|
NotEmpty.person.password = Password is required!
|
|
@ -12,6 +12,12 @@
|
||||||
color: #ff0000;
|
color: #ff0000;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.errorbox {
|
||||||
|
|
||||||
|
background-color: #ffEEEE;
|
||||||
|
border: 2px solid #ff0000;
|
||||||
|
}
|
||||||
|
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
<body>
|
<body>
|
||||||
|
@ -20,13 +26,13 @@
|
||||||
|
|
||||||
<form:form method="POST" action="/spring-mvc-xml/addPerson" modelAttribute="person" enctype="multipart/form-data">
|
<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>
|
<table>
|
||||||
<tr>
|
<tr>
|
||||||
<td><form:label path="name">Name</form:label></td>
|
<td><form:label path="name">Name</form:label></td>
|
||||||
<td><form:input path="name" /></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>
|
||||||
<tr>
|
<tr>
|
||||||
<td><form:label path="email">E-mail</form:label></td>
|
<td><form:label path="email">E-mail</form:label></td>
|
||||||
|
|
|
@ -29,7 +29,7 @@
|
||||||
<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
|
<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
|
||||||
<load-on-startup>1</load-on-startup>
|
<load-on-startup>1</load-on-startup>
|
||||||
<multipart-config>
|
<multipart-config>
|
||||||
<location>C:/Users/ivan/Desktop/tmp</location>
|
<location>/tmp</location>
|
||||||
</multipart-config>
|
</multipart-config>
|
||||||
</servlet>
|
</servlet>
|
||||||
<servlet-mapping>
|
<servlet-mapping>
|
||||||
|
|
Loading…
Reference in New Issue