zoukankan      html  css  js  c++  java
  • 随手记

    js怎么获取后台model中的值

    利用el表达式:@RequestMapping(value = "index")->的意思就是将index中的数据当做值传出来

    Spring mvc 中model.addAttribute("student",student)请问这句是什么意思

    按照spring一般的编码习惯,model应该是cotrller里面的Map结构。Map里面添加啦key="student" , value = "student对象"的意思,最后吧这个model返回一个jsp,在jsp页面上就能获得这个student对象了。然后页面中利用“student” (key值) 获取值

    <c:forEach var="netNews" items="${informs}"> //这里的var是key值 item=${随便取名}
      
    <a title="${netNews.title }" href="${netNews.url }.html" target="_blank"> ${fn:substring(netNews.title,0,13) } <c:if test="${fn:length(netNews.title)>13}">...</c:if> </a> </c:forEach>

    java中的实体 XXX.java

    实体就是具体的类。像MVC中的M指的就是实体。分为业务逻辑层,KAO层,控制器层。

    业务逻辑层和KAO层,操作的就是实例对象。

    一般把从数据库中取出来的单条数据包装成实体类方便操作,或者把一个java程序里面的具体类封装成实体。

    eg:是为了页面方便获取数据title

    private Integer id;
        private String title;//标题
        private Timestamp createTime;//
        private Integer userId;//
        private Integer type;//消息类型0普通 1通知 2新闻 3产品 4其他
  • 相关阅读:
    基于摸板匹配的目標跟蹤算法
    spoj 2713 Can you answer these queries IV
    zoj 3633 Alice's present
    hdu 3642 Get The Treasury
    poj 1195 Mobile phones
    poj 2760 End of Windless Days
    zoj 3540 Adding New Machine
    spoj 1716 Can you answer these queries III
    spoj 1043 Can you answer these queries I
    spoj 2916 Can you answer these queries V
  • 原文地址:https://www.cnblogs.com/jin-000/p/6605108.html
Copyright © 2011-2022 走看看