我创建了一个包含以下信息的 java bean:
包:com.mysite
类别:文件夹
该文件位于 ROOT/WEB-INF/classes/com/mysite/Folders.class
电话是:
<jsp:useBean id="folders" scope="session" class="com.mysite.Folders" />
如果它有帮助的话,这就是这门课,它很简单,因为我想在做任何更复杂的事情之前启动并运行它。
public class Folders implements Serializable {
public Folders(String accountNumber, String folderName, String groupName, ArrayList<String> folderNames, ArrayList<String> groupNames) {
this.accountNumber = accountNumber;
this.folderName = folderName;
this.groupName = groupName;
this.folderNames = folderNames;
this.groupNames = groupNames;
}
public String getAccountNumber() {
return accountNumber;
}
public void setAccountNumber(String accountNumber) {
this.accountNumber = accountNumber;
}
public String getFolderName() {
return folderName;
}
public void setFolderName(String folderName) {
this.folderName = folderName;
}
public ArrayList<String> getFolderNames() {
return folderNames;
}
public void setFolderNames(ArrayList<String> folderNames) {
this.folderNames = folderNames;
}
public String getGroupName() {
return groupName;
}
public void setGroupName(String groupName) {
this.groupName = groupName;
}
public ArrayList<String> getGroupNames() {
return groupNames;
}
public void setGroupNames(ArrayList<String> groupNames) {
this.groupNames = groupNames;
}
private String accountNumber;
private String folderName;
private String groupName;
private ArrayList<String> folderNames;
private ArrayList<String> groupNames;
}
每次都得到相同的结果。
错误是:
SEVERE: Servlet.service() for servlet jsp threw exception org.apache.jasper.JasperException: /custom/folders.jsp(13,0) The value for the useBean class attribute com.mysite.Folders is invalid.
我已经重新启动了 Tomcat 和服务器本身,但都没有帮助。对此问题的任何见解都非常感谢。