分页
上面这两个工具条,可以运用在任何一个管理中,此时可以将这个作为一个页面来插入任何一个页面,这就实现了页面重用。
分页页面使用到的数据有4整数,一个集合 参考PageBean
pagehelper使用
(1)依赖
(2)配置
- applicationContext-dao.xml(export_parent\export_dao\src\main\resources\spring)
<!--2.配置Spring整合Mybatis *** 由Spring创建SqlSessionFactory对象-->
<!--2.1 配置SqlSessionFactoryBean-->
<bean id="sqlSessionFactory" class="org.mybatis.spring.SqlSessionFactoryBean">
<!--注入数据源-->
<property name="dataSource" ref="dataSource"/>
<!-- com.wzx.domain.company.Company company-->
<property name="typeAliasesPackage" value="com.smp.domain"/>
<!-- PageHelper配置 -->
<property name="plugins">
<array>
<bean class="com.github.pagehelper.PageInterceptor">
<property name="properties">
<!--使用下面的方式配置参数,一行配置一个 -->
<!-- pageNum<=0 时会查询第一页 -->
<!-- 指定数据库方言 -->
<value>
reasonable=true
helperDialect=mysql
</value>
</property>
</bean>
</array>
</property>
</bean>
jsp代码重用
- (1)jsp代码是可以重用
- (2)jsp代码如何重用?
建立jsp页面 A,保存重用代码
在当前页面 B 中引入A
通过<jsp:include>
来实现页面重用
<jsp:include page="A.jsp" />
(3)B可以将参数传给A
<!-- 页面A传递参数 -->
<jsp:param name&