Struts2 长变量的set方法(setMobile())在struts 2框架的action类运行时出错
在上述代码中,setMobileLong mobile方法给出以下例外情况: java.lang.NoSuchMethodException:com.kumar.student.StudentAction.setMobile[Ljava.lang.StringStruts2 长变量的set方法(setMobile())在struts 2框架的action类运行时出错,struts2,Struts2,在上述代码中,setMobileLong mobile方法给出以下例外情况: java.lang.NoSuchMethodException:com.kumar.student.StudentAction.setMobile[Ljava.lang.String 发布完整的stacktrace。你忘了问问题。你提交的值是多少?我提交的手机号码由10位数字组成,如9052599254 package com.kumar.student; import java.util.List; import
发布完整的stacktrace。你忘了问问题。你提交的值是多少?我提交的手机号码由10位数字组成,如9052599254
package com.kumar.student;
import java.util.List;
import com.opensymphony.xwork2.ActionSupport;
public class StudentAction extends ActionSupport {
private static final long serialVersionUID = 1L;
private String name;
private String rollNumber;
private String department;
private String year;
private String dob;
private String email;
private long mobile;
private List<String> gender;
@Override
public String execute() {
return "success";
}
// all setter & getter method for remaining variable
public long getMobile() {
return mobile;
}
public void setMobile(long mobile) {
this.mobile = mobile;
}
public List<String> getGender() {
return gender;
}
public void setGender(List<String> gender) {
this.gender = gender;
}
}