-
Notifications
You must be signed in to change notification settings - Fork 20
/
Copy pathadd.jsp
139 lines (120 loc) · 5.3 KB
/
add.jsp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme() + "://"
+ request.getServerName() + ":" + request.getServerPort()
+ path + "/";
%>
<!-- <Context docBase="D:\tomcat\apache-tomcat-7.0.57\webapps\upload\images" path="/pic" reloadable="false"/> -->
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<base href="<%=basePath%>">
<title>My JSP 'add.jsp' starting page</title>
<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
<meta http-equiv="description" content="This is my page">
<!--
<link rel="stylesheet" type="text/css" href="styles.css">
-->
<script type="text/javascript">
function getOption(){
var s1 =document.getElementById("s1").value;
//将当前页面的值 存放在高级查询表单隐藏域中
var index= s1.selectedIndex;
var text=s1.options[index].text;
}
function getSeleteInput(){
var s1 = document.getElementById("s1").value;
document.getElementById("seleteInput").value=s1;
//将当前页面的值 存放在高级查询表单隐藏域中
}
</script>
<style type="text/css">
#f1{
display: inline-block;
}
#f2{
display: inline-block;
position: relative;
left:-250px;
}
#div1{
border: 1px solid blue;
width: 450px;
height: 50px;
padding: 10px;
}
body{
background-image: url("houTai/timg1.jpg") ;
background-size:cover;
}
</style>
<meta charset="utf-8">
<title>Bootstrap 实例 - 基本表单</title>
<link rel="stylesheet" href="http://cdn.static.runoob.com/libs/bootstrap/3.3.7/css/bootstrap.min.css">
<script src="http://cdn.static.runoob.com/libs/jquery/2.1.1/jquery.min.js"></script>
<script src="http://cdn.static.runoob.com/libs/bootstrap/3.3.7/js/bootstrap.min.js"></script>
<link rel="stylesheet" href="http://cdn.static.runoob.com/libs/bootstrap/3.3.7/css/bootstrap.min.css">
<script src="http://cdn.static.runoob.com/libs/jquery/2.1.1/jquery.min.js"></script>
<script src="http://cdn.static.runoob.com/libs/bootstrap/3.3.7/js/bootstrap.min.js"></script>
</head>
<body >
<%
//生成随机数
String token = UUID.randomUUID().toString();
//把随机数放在session中
request.getSession().setAttribute("TOKEN_IN_SESSION", token);
%>
<h2 style="color: orange">添加商品属性</h2>
<form action="/shoppingPro/upload" method="post" enctype="multipart/form-data" id="f1" role="form">
商品名称:  <input type="text" name="name" size=50 required=required><br />
<br /> 价格:    <input type="number" placeholder="请输入数字" required=required name="price" size=4> 原价:<input
type="number" placeholder="请输入数字" name="costprice" size=4> 属性:<input type="text"
name="property" required=required placeholder="属性之间请用'/'隔开"><br />
<br /> 包装:    <input type="text" required=required name="packing" placeholder="不同包装请用'/'隔开">
库存:<input type="number" placeholder="请输入数字" required=required name="stock" size=4><br />
<br /> 分类编号:  <select id="s1" onchange="getSeleteInput();" >
<option value="请选择" selected="selected">请选择</option>
<c:forEach items="${productDirs}" var="dir" varStatus="v">
<option value="${dir.id}" ${1==dir.id?"selected='selected'
":""} id="${dir.id} ">${dir.bigName} </option>
</c:forEach>
</select>
上传图片:<input style="width: 200px;height: 30px; " id="f1" type="file"
name="imgpath"><br />
<br /> 网页跳转地址:<input type="text" name="website"><br />
<br /> 网页编辑地址:<input type="text" name="website"><br />
<br /> <input type="hidden" name="token"
value="${sessionScope.TOKEN_IN_SESSION }" > 店面品牌:  <input
type="text" name="website" required=required><br />
<br /> 商品介绍:  <input type="text" required=required name="website" size=45><br />
<%-- <select id="s1">
<option value="">请选择</option>
<c:forEach items="${productDirs}" var="dir" varStatus="v">
<option value="${dir.bigName}" ${1==dir.id?"selected='selected'
":""} id="${dir.id} ">${dir.bigName}</option>
</c:forEach> --%>
<input type="hidden" name="s1" size=5 value="1" id="seleteInput" >
<br /> <input class="btn btn-default" type="submit" value="添加商品"
style="width: 100px;height: 50px" ">
</form>
<form action="/shoppingPro/upload" id="f2">
<input type="submit" class="btn btn-default" value="商品管理"
style="width: 100px;height: 50px;" >
</form>
<h2 style="color: red">${success }</h2>
<h2 style="color: red">${re1 }</h2>
<div id="div1">
<form action="/shoppingPro/addKind" method="get" class="form-inline" role="form">
<div class="form-group"> 商品种类:<input type="text" name="name" required="required" placeholder="添加商品种类"></div>
<input class="form-control" type="hidden" name="token"
value="${sessionScope.TOKEN_IN_SESSION }"> <input
type="submit" class="btn btn-default" value="添加">
</form>
</div>
</body>
</html>