页面时间的展示

import java.text.SimpleDateFormat;
import java.util.Date;


Person person = new Person();
        person.setName("james");
        person.setAge(28);
        person.setAddress("maami");
        SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd");
        Date date = format.parse("1985-04-22");
        person.setBirthday(date);
        map.put("p", person);
        return "index";

<%@taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"%>


  <h1>${p.name }</h1>
    <h1>${p.age }</h1>
    <h1>${p.address }</h1>
    <h1><fmt:formatDate value="${p.birthday }" pattern="yyyy-MM-dd"/> </h1>

 

posted @ 2016-07-23 21:29  沙漠里的小鱼  阅读(122)  评论(0编辑  收藏  举报