public class Rectangle {
private Integer rLength//长
private Integer rWidth//宽
private Integer rArea//面积
public Integer getrLength() {
return rLength
}
public void setrLength(Integer rLength) {
this.rLength = rLength
}
public Integer getrWidth() {
return rWidth
}
public void setrWidth(Integer rWidth) {
this.rWidth = rWidth
}
public Integer getrArea() {
return rArea
}
public void setrArea(Integer rArea) {
this.rArea = rArea
}
} <%@ page language="java" contentType="text/html charset=UTF-8"
pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html charset=UTF-8">
<meta name="renderer" content="webkit|ie-comp|ie-stand">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport"
content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" />
<meta http-equiv="Cache-Control" content="no-siteapp" />
<script type="text/javascript" src="jquery/1.9.1/jquery.min.js"></script>
<title></title>
</head>
<body>
<div>
<form action="/xxxxxxxx" method="post" id="form-depart-edit">
<div>
<label><span>*</span>长:</label>
<div>
<input type="text" class="input-text" value="" placeholder="长" id="rLength" name="rLength">
</div>
</div>
<div>
<label><span>*</span>宽:</label>
<div>
<input type="text" class="input-text" value="" placeholder="宽" id="rWidth" name="rWidth">
</div>
</div>
<div>
<label><span>*</span>面积:</label>
<div>
<input type="text" value="" placeholder="面积" id="rArea" name="rArea" readonly="readonly">
</div>
</div>
<div>
<button onClick="jisuan()" type="button">提交</button>
</div>
</form>
</div>
<script type="text/javascript">
function jisuan(){
var rLength = $("#rLength").val()
var rWidth = $("#rWidth").val()
if(rWidth == null || rWidth == "" || rLength == null || rLength == ""){
alert("必须填写长、宽!")
return false
}
var rArea = rLength * rWidth
$("#rArea").val(rArea)
$("#form-depart-edit").submit()
}
</script>
</body>
</html>
checkRegis.jsp页给你写一部分参考一下吧
<%
String uname=request.getParameter("取值")
String upass=request.getParameter("取值")
if(uname.equls("user")){
%>
<script type="text/javascript">
alert("该用户已经注册",window.location.href="register.jsp")
</script>
<%
}
%>
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)