private String sid
private String sname
private int age
private char sex
public String getSid() {
return sid
}
public void setSid(String sid) {
this.sid = sid
}
public String getSname() {
return sname
}
public void setSname(String sname) {
this.sname = sname
}
腊孝 public int getAge() {
return age
}
public void setAge(int age) {
this.age = age
}
public char getSex() {
return sex
}
public void setSex(char sex) {
this.sex = sex
}
@Override
public int hashCode() {
final int prime = 31
蔽空 int result = 1
result = prime 轮并稿* result + age
result = prime * result + sex
result = prime * result + ((sid == null) ? 0 : sid.hashCode())
result = prime * result + ((sname == null) ? 0 : sname.hashCode())
return result
}
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>
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)