zoukankan      html  css  js  c++  java
  • 6.27-JSTL、标签、分页

    一、JSTL
        条件标签:
        
        <c:if>   if
        if(){
        }else if(){
        }else{
        }
        <c:choose>
            <c:when></c:when>
            <c:when></c:when>
            <c:otherwise></c:otherwise>
        </c:choose>
        
        
        通用标签:
            <c:set target="${person}" property="pnme" value="李四"></c:set>
        
        jsp标签实现转发
        <jsp:forward page=""></jsp:forward>
        迭代标签:
        <c:forEach>
        
        </c:forEach>
        
        *jsp页面放在WEB-INF下
            页面放在WEB-INF目录下面,这样可以限制访问,提高安全性.如JSP,html
            只能用转向方式来访问WEB-INF目录下的JSP
    二、分页实现
        总记录:totalRecords         从数据库查询
        每页显示多少条: pageSize    自定义  
        总页数:  totalPages         通过总记录数和页容量计算出来
            totalRecords%pageSize==0?  totalRecords/pageSize : totalRecords/pageSize+1
        当前页码: currentPage         页面传递
        每页数据:List                从数据库查询
        每页查询开始的索引   startIndex  通过当前页数和页容量计算出来
            startIndex = (currentPage-1)*pageSize 
        定义一个Page类
            
        
        
    三、Servlet3.0 注解配置
        
        
    志存高远,脚踏实地!
  • 相关阅读:
    Repeater OnItemCommand 失效
    继承类时的 this 和 base
    想当然造成的的错误
    排序算法二叉树
    href 一个正则表达式的解析 ? 号解析
    给父窗口添加新的代码
    ValidationSummary 控件
    交叉表 学习
    定向思维 C# datediff
    cookie 问题
  • 原文地址:https://www.cnblogs.com/benben2013A/p/7088072.html
Copyright © 2011-2022 走看看