日期:2014-05-17  浏览次数:20864 次

EL表达式问题:javax.el.PropertyNotFoundException
javax.el.PropertyNotFoundException: Property 'pNum' not found on type com.manager.Paper

manager中的代码是:

package com.manager;

public class Paper 
{
private int pNum;//第几页
private int pSize;//每页的大小
private int totalSize;//总的大小
private int totalPaper;//共有几页

public int getPNum() {
return pNum;
}
public void setPNum(int num) {
pNum = num;
}
public int getPSize() {
return pSize;
}
public void setPSize(int size) {
pSize = size;
}
public int getTotalSize() {
return totalSize;
}
public void setTotalSize(int totalSize) {
this.totalSize = totalSize;
}
public int getTotalPaper() {
return totalPaper;
}
public void setTotalPaper(int totalPaper) {
this.totalPaper = totalPaper;
}

public Paper getPaper(int pNum,int pSize,int totalSize)
{
if(pSize == 0)
{
this.pSize = 5;
}
if(pNum == 0)
{
this.pNum = 1;
}
if(totalSize % pSize ==0)
{
this.totalPaper = totalSize / pSize;
}else
{
this.totalPaper = totalSize / pSize + 1;
}

this.pNum = pNum;
this.pSize = pSize;
this.totalSize = totalSize;

return this;
}
}

action中的代码:

public class UserAction extends ActionSupport implements ServletRequestAware
{
private int id;
private String username;
private int age;
private String department;
private UserManager userManager;
private List userList;
private User user;
private int apNum=1;//第几页
private int apSize=5;//每页的大小
private HttpServletRequest request;
private Paper paper;

public Paper getPaper() {
return paper;
}

public void setPaper(Paper paper) {
this.paper = paper;
}

public int getId() {
return id;
}

public void setId(int id) {
this.id = id;
}

public String getUsername() {
return username;
}

public void setUsername(String username) {
this.username = username;
}

public int getAge() {
return age;
}

public void setAge(int age) {
this.age = age;
}

public String getDepartment() {
return department;
}

public void setDepartment(String department) {
this.department = department;
}

public UserManager getUserManager() {
return userManager;
}

public void setUserManager(UserManager userManager) {
this.userManager = userManager;
}

public List getUserList() {
return userList;
}

public void setUserList(List userList) {
this.userList = userList;
}

public User getUser() {
return user;
}

public void setUser(User user) {
this.user = user;
}

public int getApNum() {
return apNum;
}

public void setApNum(int apNum) {
this.apNum = apNum;
}

public int getApSize() {
return apSize;
}

public void setApSize(int apSize) {
this.apSize = apSize;
}

public void setServletRequest(HttpServletRequest request) {
this.request = request;
}


public String load4UserList() //
{
Paper paper = this.getAPaper();
this.userList = this.userManager.userList(paper);
HttpSession session = request.getSession();
sessi