案例
来源:互联网 发布:手机自动抢货秒杀软件 编辑:程序博客网 时间:2024/04/28 04:30
package com.hbsi.bean;
import java.util.Date;
public class Persion {
private String name;
private int age;
private Date birthday;
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public int getAge() {
return age;
}
public void setAge(int age) {
this.age = age;
}
public Date getBirthday() {
return birthday;
}
public void setBirthday(Date birthday) {
this.birthday = birthday;
}
public Persion() {
super();
// TODO Auto-generated constructor stub
}
public Persion(String name, int age, Date birthday) {
super();
this.name = name;
this.age = age;
this.birthday = birthday;
}
}
<body background="image/12.jpg"><center>
<font size="8" color="red">提交表单</font>
<form action="persion.jsp" method="post">
用户名:<input type="text" name="username"/><br/><br/>
年 龄:<input type="text" name="age"/><br/><br/>
生 日:<input type="text" name="birthday"/><br/><br/>
<input type="submit" value="提交"/><input type="reset" value="重置"/>
</form>
</body>
<body>
<%
request.setCharacterEncoding("UTF-8");
%>
<jsp:useBean id="persion" class="com.hbsi.bean.Persion" scope="page"></jsp:useBean>
<jsp:setProperty property="name" name="persion" param="username"/>
<jsp:setProperty property="age" name="persion" param="age"/>
<%
String date=request.getParameter("birthday");
DateFormat df=DateFormat.getDateInstance();
Date date1 = df.parse(date);
%>
<jsp:setProperty property="birthday" name="persion" value="<%=date1 %>"/>
<%="姓名:"+persion.getName() %><br/>
<%="年龄:"+persion.getAge() %><br/>
<%="生日:"+persion.getBirthday().toLocaleString() %>
</body>
- 案例
- 案例
- 案例
- 案例
- 案例
- 案例
- 案例
- 案例
- 成功案例
- 案例学习
- Sales 案例
- 新东方案例
- Openlaszlo案例
- MDX案例
- MDX案例
- 案例分析
- 管理学案例
- TestMock案例
- Uboot介绍
- javaBean
- 实现Django的全文检索功能(一):选择Whoosh全文检索引擎
- cunchuguocheng
- 用QtCreator实现可扩展对话框实验
- 案例
- JSTL标准标签库
- android usb 分析
- time.h头文件
- JavaWeb项目升级版本之后导入上一个版本
- asp.net小数点【取整】和【四舍五入】的方法!
- 数据结构
- 三年,回忆(三)
- 误删Oracle数据文件导致数据库无法打开