从数据库中读出Data数据:

而想实现的是这样:

解决办法:

1. 在这个类里添加自定义的变量birthf:

public abstract class AbstractUsers implements java.io.Serializable {

…… ;

private String birthf;

}

2. 在各个构造函数中添加:

public AbstractUsers(…… , String birthf) {

…… ;
             this.birthf = birthf;
}

3. 生成get,set函数,再在get函数里添加代码:

public String getBirthf() {
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd ");
Date date = (Date) this.getBirth();
birthf = sdf.format(date);
return birthf;
}

4. 在Users类里各构造函数里添加:

public class Users extends AbstractUsers implements java.io.Serializable {

public Users(……, String birthf) {
super(……,birthf);
}

}

5. 在.jsp中添加:

<li><span>出生日期:</span><%=user.getBirthf() %></li>

最新文章

  1. Git入门资料汇总
  2. web前端性能优化指南(转)
  3. Design3:使用HierarchyID构建数据的分层结构
  4. PyQt4自定义事件
  5. Dedecms include\dialog\select_soft_post.php Upload Any Files To The Specified Directory Via Variable Not Initial Flaw Bypass Extension Defence
  6. hdu 4345 Permutation 记忆化搜索
  7. linux ps top 命令 VSZ,RSS,TTY,STAT, VIRT,RES,SHR,DATA的含义【转】
  8. 模板方法模式(Template Method)
  9. POJ 2455 Secret Milking Machine (二分+无向图最大流)
  10. 布局重用 include merge ViewStub
  11. Google推出iOS功能性UI测试框架EarlGrey
  12. poj 3613 floyd + 快速幂
  13. 自学python Day01
  14. 输入docker ps 报错信息处理Get http:///var/run/docker.sock/v1.19/containers/json: dial unix /var/run/docker.sock: permission denied.
  15. Go 语言数据类型
  16. 在Unity3D里使用WinForm
  17. effective java——30使用enum
  18. zabbix 监控 redis
  19. Windows 操作系统与内核版本号
  20. Django之Models进阶操作(字段属性)

热门文章

  1. macOS Sierra 触控板无法三指拖移窗口、三指选中文字的解决方法
  2. psql 工具详细使用介绍
  3. koa2 + webpack 热更新
  4. koa2在node6中如何运行
  5. 我的第一个python程序——猜数字
  6. firewalld的防火墙
  7. [cocos2dx enhancement] CCPlatformMacros.h
  8. Mysql实战之索引
  9. POJ 2217:Secretary(后缀数组)
  10. HDFS设计思想