首页 新闻 赞助 找找看

java里的enctype表单传输取值方法后端该怎么取值 取值类型为string类型

0
悬赏园豆:10 解决于 2018-12-24 19:55

<%@ page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xml:lang="ja" lang="ja">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>登记商品</title>
<!--
<link type="text/css" rel="stylesheet" href="exValidation/css/style.css" />
-->
<link type="text/css" rel="stylesheet" href="exValidation/css/exvalidation.css" />
</head>
<body>

<h1>登记商品</h1>
<%if(request.getAttribute("chfErrFlg00")!=null){
if(!request.getAttribute("chfErrFlg00").equals("0")){
%>
<b><font color="#ff0000">
商品名重复<br>请改变商品名
</font></b>
<br>
<br>
<%
}
} %>

<a href="list.jsp">搜索商品页面</a><br><br>

<form action = "AddController" method = "post" enctype="multipart/form-data">
<table cellspacing="1" cellpadding="8" border="0" bgcolor="#999999">
<tr>
<th width="100" bgcolor="#EBEBEB">商品编号</th>
<td width="250" bgcolor="#FFFFFF"><input type="text" id="code" name="code" readonly="readonly" value=""> </td>
</tr>
<tr>
<th width="100" bgcolor="#EBEBEB">商品名<sup><font color="#FF0000"></font></sup></th>
<td width="250" bgcolor="#FFFFFF"><input type="text" id="name" name="name" value=""> </td>
</tr>
<tr>
<th width="100" bgcolor="#EBEBEB">金额<sup><font color="#FF0000">
</font></sup></th>
<td width="250" bgcolor="#FFFFFF"><input type="text" id="unitPrice" name="unitPrice" value=""> </td>
</tr>
<tr>
<th width="100" bgcolor="#EBEBEB">数量<sup><font color="#FF0000">*</font></sup></th>
<td width="250" bgcolor="#FFFFFF"><input type="text" id="count" name="count" value=""> </td>
</tr>
<tr>
<th width="100" bgcolor="#EBEBEB">商品图像</th>
<td width="250" bgcolor="#FFFFFF"><input type="file" id="image" name="image"> </td>

</tr>
<tr>
<th bgcolor="#EBEBEB">推荐的商品</th>
<td bgcolor="#FFFFFF"><input type="checkbox" id="isPR" name="isPR" value="1"{% if item.isPR %} checked{% endif %}>登记推荐的商品</input>
</input type="hidden" name="isPR" value="0">
</td>
</tr>
</table><br>
<input type="submit"
onclick="if(confirm('登记商品数据吗?')){
return true;
}else{
return false;
}"
value="登记">
</form>

<br>
<font color="#FF0000">*</font>是必须输入的項目

</body>
<!--[removed][removed]-->
<script type="text/javascript" src="exValidation/js/jquery.min.js"></script>
<script type="text/javascript" src="exValidation/js/jquery.easing.js"></script>
<script type="text/javascript" src="xValidation/js/jQselectable.js"></script>
<script type="text/javascript" src="exValidation/js/exchecker-ja.js"></script>
<script type="text/javascript" src="exValidation/js/exvalidation.js"></script>
<script type="text/javascript" >

var validation = $("form")
.exValidation({
rules: {
name: "chkrequired chkmax200",
unitPrice: "chkrequired chknumonly chkmin1 chknum1000",
count: "chkrequired chknumonly chkmin1 chknum100",
filename:"chkfile"
},
stepValidation: true
});
</script>
</html>

八月呐的主页 八月呐 | 初学一级 | 园豆:194
提问于:2018-12-22 21:37
< >
分享
清除回答草稿
   您需要登录以后才能回答,未注册用户请先注册