【前端开发 bootstrap框架 pagehelper分页 】bootstrap和pagehelper分页插件的学习使用 bootstrap模板 pagehelper的配置

bootstrap框架

bootstrap是什么?
Bootstrap是Twitter推出的一个用于前端开发的开源工具包。它由Twitter的设计师Mark Otto和Jacob Thornton合作开发,是一个CSS/HTML框架

bootstrap的使用步骤(bootstrap模板)配置、使用、测试

使用bootstrap

(1)复制bootstrap的内容到webapp文件夹
(2)在页面引入
(3)使用项目访问路径 ${path}
(4)设置spring-mvc的静态资源拦截规则
(5)测试

复制bootstrap的内容(css/js/fonts等)到项目的webapp文件夹

在这里插入图片描述

在页面引入

1.3个meta标签必须放在最前面,任何其他内容都必须跟随其后
2.jQuery (Bootstrap 的所有 JavaScript 插件都依赖 jQuery,所以必须放在前边)

<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <!-- 上述3个meta标签*必须*放在最前面,任何其他内容都*必须*跟随其后! -->
    <%pageContext.setAttribute("path",request.getContextPath());%>
    <%--上述 拿到项目地址--%>
    <link href="${path}/css/bootstrap.min.css" rel="stylesheet">
    <!-- jQuery (Bootstrap 的所有 JavaScript 插件都依赖 jQuery,所以必须放在前边) -->
    <script src="${path}/js/jquery-1.11.0.min.js"></script>
    <!-- 加载 Bootstrap 的所有 JavaScript 插件。你也可以根据需要只加载单个插件。 -->
    <script src="${path}/js/bootstrap.min.js"></script>

    <title>Title</title>
</head>

使用项目访问路径 ${path}

 <%pageContext.setAttribute("path",request.getContextPath());%>

设置spring-mvc的静态资源拦截规则

  <!--过滤静态资源   .js .css png-->
    <mvc:resources location="/css/" mapping="/css/**" />
    <mvc:resources location="/images/" mapping="/images/**" />
    <mvc:resources location="/js/" mapping="/js/**" />
    <mvc:resources location="/fonts/" mapping="/fonts/**" />

使用

然后在bootstrap的官网上搬运css样式
https://v3.bootcss.com/css/

pagehelper分页

不使用插件时

创建pageBean 四个参数 总条数 总页数 每页条数 当前第几页 一个集合(四个整数的数据)

总条数(total): select count(*) from company
每页条数(pagesize):自己定
总页数: total%pagesize==0?total/pagesize:total/pagesize+1
当前几页(currentpage)
集合list:start ,pagesize
start:(currentpage-1)*pagesize limit start ,pagesize
分页
select * from company where limit start ,pagesize(当前页的数据是在数据库中start行开始,到start+pagesize行结束)

pagehelper分页插件介绍

pagehelper是什么?
针对Mybatis提供分页插件,将分页查询简化

pagehelper分页配置

(1)依赖配置 pagehelper
(2)配置插件plugin
》1 : mybatis核心配置文件,在application中引入 mybatis核心配置文件
》2 : 直接在application中配置

pom.xml 依赖配置

  <!--引入pageHelper分页插件 -->
    <dependency>
      <groupId>com.github.pagehelper</groupId>
      <artifactId>pagehelper</artifactId>
      <version>5.0.0</version
  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值