springMVC+hibernate+spring+shiro整合
springMVC+hibernate+spring+shiro整合例子
springMVC、hibernate、spring与shiro集成
代码片段和文件信息
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 783 2014-04-06 18:59 test_ssh.classpath
文件 552 2014-03-29 22:19 test_ssh.externalToolBuildersorg.eclipse.wst.common.project.facet.core.builder.launch
文件 548 2014-03-29 22:19 test_ssh.externalToolBuildersorg.eclipse.wst.jsdt.core.javascriptValidator.launch
文件 547 2014-03-29 22:19 test_ssh.externalToolBuildersorg.eclipse.wst.validation.validationbuilder.launch
文件 1734 2014-03-29 22:19 test_ssh.project
文件 503 2013-05-30 10:00 test_ssh.settings.jsdtscope
文件 57 2014-04-04 22:43 test_ssh.settingsorg.eclipse.core.resources.prefs
文件 364 2013-05-30 10:00 test_ssh.settingsorg.eclipse.jdt.core.prefs
文件 553 2014-04-06 18:59 test_ssh.settingsorg.eclipse.wst.common.component
文件 305 2013-05-30 16:21 test_ssh.settingsorg.eclipse.wst.common.project.facet.core.xml
文件 49 2013-05-30 10:00 test_ssh.settingsorg.eclipse.wst.jsdt.ui.superType.container
文件 6 2013-05-30 10:00 test_ssh.settingsorg.eclipse.wst.jsdt.ui.superType.name
文件 4148 2014-04-08 22:41 test_sshsrccomwork614commonPagination.java
文件 2231 2014-04-08 22:43 test_sshsrccomwork614commonQueryResult.java
文件 9042 2014-04-08 21:46 test_sshsrccomwork614commonRecord.java
文件 2954 2014-04-08 21:51 test_sshsrccomwork614commonTreeResult.java
文件 2098 2014-04-10 22:06 test_sshsrccomwork614controllerUserController.java
文件 6639 2014-04-08 22:46 test_sshsrccomwork614daoaseDao.java
文件 1507 2014-04-06 18:48 test_sshsrccomwork614daoIbaseDao.java
文件 313 2014-04-06 21:37 test_sshsrccomwork614daoUserDao.java
文件 1166 2014-04-07 23:13 test_sshsrccomwork614daoUserDaoImpl.java
文件 1728 2014-04-10 22:47 test_sshsrccomwork614entityPermission.java
文件 1399 2014-04-10 22:16 test_sshsrccomwork614entityRole.java
文件 1677 2014-04-10 22:19 test_sshsrccomwork614entityUser.java
文件 358 2014-04-07 13:04 test_sshsrccomwork614serviceUserService.java
文件 2277 2014-04-10 22:08 test_sshsrccomwork614serviceUserServiceImpl.java
文件 2711 2014-04-10 21:44 test_sshsrccomwork614shiroUserAuthorizingRealm.java
文件 12981 2014-04-07 21:24 test_sshsrccomwork614utilDateUtils.java
文件 3641 2014-04-07 23:11 test_sshsrccomwork614utilEncryptUtils.java
文件 29223 2014-04-08 21:45 test_sshsrccomwork614utilLangUtils.java
............此处省略715个文件信息
/**
* @文件名 Pagination.java
* @包名 com.work614.common
* @说明 通用分页对象 用于承载分页信息
* @作者 zdyang
* @时间 2014年4月8日 下午9:59:38
* @版本 V1.0
*/
package com.work614.common;
/**
* @类名 Pagination
* @author zdyang
* @描述 通用分页方法封装
* @日期 2014年4月8日 下午10:41:34
*/
public class Pagination {
/**
* 总页数,通过总记录数和每页显示记录条数计算获得
*/
private int totalPage;
/**
* 总记录数
*/
private int totalCount;
/**
* 当前页,默认是第一页
*/
private int currentPage = 1;
/**
* 每页显示记录条数 ,默认是每页显示10条记录
*/
private int pageSize = 10;
/**
* 开始索引,通过当前页和每页显示记录条数计算获得
*/
private int startIndex;
public Pagination() {
}
/**
* 两个参数的构造方法,调用该构造方法需要另行设置结果list
*
* @param currentPage
* 当前页
* @param countRecord
* 总页数
*/
public Pagination(int currentPage int totalCount) {
this.currentPage = currentPage;
this.totalCount = totalCount;
calculate();
}
/**
* 能够设置一页显示多少条记录的构造方法
*
* @param currentPage
* 当前页
* @param countRecord
* 总记录数
* @param onePageCount
* 每页最多显示的记录条数
*/
public Pagination(int currentPage int totalCount int pageSize) {
super();
this.totalCount = totalCount;
this.currentPage = currentPage;
this.pageSize = pageSize;
calculate();
}
/**
* 计算开始索引和总页数
*/
private void calculate() {
// 计算开始索引
this.startIndex = (currentPage - 1) * pageSize;
// 计算总页数
this.totalPage = (totalCount % pageSize == 0) ? (totalCount / pageSize)
: (totalCount / pageSize + 1);
}
// 判断能否到第一页;只要能到上一页,肯定就有第一页
public boolean firstEnable() {
return previousEnable();
}
// 判断能否到上一页
public boolean previousEnable() {
return currentPage > 1;// 只要不是第一页,就能到上一页
}
// 判断能否到下一页
public boolean nextEnable() {
return currentPage * pageSize < this.totalCount;
}
// 判断能否到最后一页;只要有下一页,就肯定有最后一页.
public boolean lastEnable() {
return nextEnable();
}
// 跳到第一页
public void firstPage() {
currentPage = 1;
}
// 跳到上一页
public void previousPage(int cPage) {
currentPage = (cPage - 1) > 0 ? (cPage - 1) : 1;
}
// 跳到下一页
public void nextPage(int cPage) {
currentPage = cPage + 1;
if (currentPage * pageSize > this.totalCount) {
lastPage();
}
}
// 跳到最后一页
public void lastPage() {
if (this.totalCount % pageSize == 0) {
currentPage = this.totalCount / pageSize;
} else {
currentPage = this.totalCount / pageSize + 1;
}
}
// 跳到指定的某一页
public void gotoPage(int pageNumber) {
if (pageNumber <= 1) {
currentPage = 1;
} else if (getTotalCount() < this.getPageSize()) {
currentPage = 1;
} else if (pageNumber * pageSize >= this.totalCount) {
lastPage();
} else {
currentPage = pageNumber;
}
}
public int getTotalPage() {
return totalPage;
}
public int getTotalCount() {
return totalCount;
}
public int getCurrentPage() {
return currentPage;
}
public int getPageSize() {
return
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 783 2014-04-06 18:59 test_ssh.classpath
文件 552 2014-03-29 22:19 test_ssh.externalToolBuildersorg.eclipse.wst.common.project.facet.core.builder.launch
文件 548 2014-03-29 22:19 test_ssh.externalToolBuildersorg.eclipse.wst.jsdt.core.ja
文件 547 2014-03-29 22:19 test_ssh.externalToolBuildersorg.eclipse.wst.validation.validationbuilder.launch
文件 1734 2014-03-29 22:19 test_ssh.project
文件 503 2013-05-30 10:00 test_ssh.settings.jsdtscope
文件 57 2014-04-04 22:43 test_ssh.settingsorg.eclipse.core.resources.prefs
文件 364 2013-05-30 10:00 test_ssh.settingsorg.eclipse.jdt.core.prefs
文件 553 2014-04-06 18:59 test_ssh.settingsorg.eclipse.wst.common.component
文件 305 2013-05-30 16:21 test_ssh.settingsorg.eclipse.wst.common.project.facet.core.xm
文件 49 2013-05-30 10:00 test_ssh.settingsorg.eclipse.wst.jsdt.ui.superType.container
文件 6 2013-05-30 10:00 test_ssh.settingsorg.eclipse.wst.jsdt.ui.superType.name
文件 4148 2014-04-08 22:41 test_sshsrccomwork614commonPagination.java
文件 2231 2014-04-08 22:43 test_sshsrccomwork614commonQueryResult.java
文件 9042 2014-04-08 21:46 test_sshsrccomwork614commonRecord.java
文件 2954 2014-04-08 21:51 test_sshsrccomwork614commonTreeResult.java
文件 2098 2014-04-10 22:06 test_sshsrccomwork614controllerUserController.java
文件 6639 2014-04-08 22:46 test_sshsrccomwork614daoa
文件 1507 2014-04-06 18:48 test_sshsrccomwork614daoIba
文件 313 2014-04-06 21:37 test_sshsrccomwork614daoUserDao.java
文件 1166 2014-04-07 23:13 test_sshsrccomwork614daoUserDaoImpl.java
文件 1728 2014-04-10 22:47 test_sshsrccomwork614entityPermission.java
文件 1399 2014-04-10 22:16 test_sshsrccomwork614entityRole.java
文件 1677 2014-04-10 22:19 test_sshsrccomwork614entityUser.java
文件 358 2014-04-07 13:04 test_sshsrccomwork614serviceUserService.java
文件 2277 2014-04-10 22:08 test_sshsrccomwork614serviceUserServiceImpl.java
文件 2711 2014-04-10 21:44 test_sshsrccomwork614shiroUserAuthorizingRealm.java
文件 12981 2014-04-07 21:24 test_sshsrccomwork614utilDateUtils.java
文件 3641 2014-04-07 23:11 test_sshsrccomwork614utilEncryptUtils.java
文件 29223 2014-04-08 21:45 test_sshsrccomwork614utilLangUtils.java
............此处省略715个文件信息
版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容, 请发送邮件举报,一经查实,本站将立刻删除。
评论列表(条)