1
+ <%@ taglib prefix =" spring" uri =" http://www.springframework.org/tags" %>
2
+ <%@ taglib prefix =" form" uri =" http://www.springframework.org/tags/form" %>
3
+ <%@ taglib prefix =" c" uri =" http://java.sun.com/jsp/jstl/core" %>
4
+ <!DOCTYPE html>
5
+ <html lang =" en" >
6
+ <head >
7
+ <meta charset =" utf-8" >
8
+ <meta http-equiv =" X-UA-Compatible" content =" IE=edge" >
9
+ <meta name =" viewport" content =" width=device-width, initial-scale=1" >
10
+ <!-- The above 3 meta tags *must* come first in the head; any other head content must come *after* these tags -->
11
+ <meta name =" description" content =" " >
12
+ <meta name =" author" content =" " >
13
+
14
+ <title >File upload demo with Spring framework</title >
15
+
16
+ <!-- Bootstrap core CSS -->
17
+ <link href =" ${ pageContext. request. contextPath } /resources/css/bootstrap.min.css" rel =" stylesheet" >
18
+
19
+ <link rel =" stylesheet" href =" ${ pageContext. request. contextPath } /resources/css/custom.css" />
20
+ </head >
21
+
22
+ <body >
23
+
24
+ <div class =" container" >
25
+ <div class =" header clearfix" >
26
+ <nav >
27
+ <ul class =" nav nav-pills pull-right" >
28
+
29
+ </ul >
30
+ </nav >
31
+ <h3 class =" text-muted" >Java Spring MVC</h3 >
32
+ </div >
33
+
34
+ <div class =" row marketing" >
35
+ <h3 >File upload form with javax/hibernate validations:</h3 >
36
+ <hr />
37
+ <c:if test =" ${ param. success == 1 } " >
38
+ <div class =" alert alert-success" >
39
+ <a href =" ${ pageContext. request. contextPath } #" class =" close" data-dismiss =" alert" aria-label =" close" >× ; </a >
40
+ <span class =" glyphicon glyphicon-thumbs-up" ></span > Your profile information has been successfully saved
41
+ </div >
42
+ </c:if >
43
+ <form:form
44
+ action =" ${ pageContext. request. contextPath } /index/saveUser"
45
+ enctype =" multipart/form-data" method =" post" commandName =" user" >
46
+ <div class =" form-group" >
47
+ <label for =" name" >Firstname</label > <form:errors path =" firstName" cssStyle =" color:#ff0000;" />
48
+ <form:input path =" firstName" id =" name" name =" name" class =" form-control" />
49
+ </div >
50
+ <div class =" form-group" >
51
+ <label for =" lastName" >Lastname</label > <form:errors path =" lastName" cssStyle =" color:#ff0000;" />
52
+ <form:input path =" lastName" id =" lastname" name =" lastname"
53
+ class =" form-control" ></form:input >
54
+ </div >
55
+ <div class =" form-group" >
56
+ <label for =" age" >Age</label > <form:errors path =" age" cssStyle =" color:#ff0000;" />
57
+ <form:input path =" age" id =" age" name =" age"
58
+ class =" form-control" ></form:input >
59
+ </div >
60
+ <div class =" form-group" >
61
+ <label for =" address" >Address</label > <form:errors path =" address" cssStyle =" color:#ff0000;" />
62
+ <form:input path =" address" id =" address" name =" address"
63
+ class =" form-control" ></form:input >
64
+ </div >
65
+ <div class =" form-group" >
66
+ <label class =" control-label" for =" productImage" >Upload Image</label >
67
+ <form:input type =" file" path =" userImage" id =" userImage" name =" userImage"
68
+ class =" form:input-large" ></form:input >
69
+ </div >
70
+ <div class =" form-group" >
71
+ <input type =" submit" value =" Submit" class =" btn btn-success" />
72
+ </div >
73
+ </form:form >
74
+ <a href =" ${ pageContext. request. contextPath } /usersList" class =" btn btn-primary pull-right" >Users</a >
75
+ </div >
76
+ <div class =" row marketing" >
77
+
78
+ </div >
79
+ <footer class =" footer" >
80
+ <p >© ; 2016 Morebodi Rekz Modise. I have left the record editing to you, but if you have tried and still struggle, then halla at me and will upload it</p >
81
+ </footer >
82
+
83
+ </div > <!-- /container -->
84
+ </body >
85
+ </html >
0 commit comments