Source not found for InvocationTargetException.求助大神

大昭逸 2018-03-23 11:38:31
求大神看下我的代码,构造中里33行计算总页数, 调Debug时,抛出异常
Source not found for InvocationTargetException.<init>(Throwable) line: not available



package com.jyd.utils;

import java.util.List;

public class PageBean {
// 当前页数
private Integer currentPage;
// 每页条数
private Integer pageSize;
// 总条数
private Integer totalCount;
// 总页数
private Integer totalPage;
// 每页数据
private List list;

// 构造
public PageBean(Integer currentPage, Integer totalCount, Integer pageSize) {
this.totalCount = totalCount;

this.pageSize = pageSize;

this.currentPage = currentPage;
// 如果没有指定显示哪一页,显示第一页
if (this.currentPage == null) {
this.currentPage = 1;
}
// 如果没有指定显示条数,默认每页显示3条
if (this.pageSize == null) {
this.pageSize = 3;
}
// 计算总页数
this.totalPage = (this.totalCount + this.pageSize - 1) / pageSize;
// 判断当前面
// 不能小于1
if (this.currentPage < 1) {
this.currentPage = 1;
}
// 不能大于最大页码
if (this.currentPage > this.totalPage) {
this.currentPage = this.totalPage;
}

}

public Integer getCurrentPage() {
return currentPage;
}

public void setCurrentPage(Integer currentPage) {
this.currentPage = currentPage;
}

public Integer getPageSize() {
return pageSize;
}

public void setPageSize(Integer pageSize) {
this.pageSize = pageSize;
}

public Integer getTotalCount() {
return totalCount;
}

public void setTotalCount(Integer totalCount) {
this.totalCount = totalCount;
}

public Integer getTotalPage() {
return totalPage;
}

public void setTotalPage(Integer totalPage) {
this.totalPage = totalPage;
}

public List getList() {
return list;
}

public void setList(List list) {
this.list = list;
}

public Integer getStart() {

return (this.currentPage - 1) * this.pageSize;
}

}

...全文
253 回复 打赏 收藏 转发到动态 举报
写回复
用AI写文章
回复
切换为时间正序
请发表友善的回复…
发表回复

67,512

社区成员

发帖
与我相关
我的任务
社区描述
J2EE只是Java企业应用。我们需要一个跨J2SE/WEB/EJB的微容器,保护我们的业务核心组件(中间件),以延续它的生命力,而不是依赖J2SE/J2EE版本。
社区管理员
  • Java EE
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧