0

I have created a java bean with the following information:

package: com.mysite

class: Folders

The file is located in ROOT/WEB-INF/classes/com/mysite/Folders.class

and the call is:

<jsp:useBean id="folders" scope="session" class="com.mysite.Folders" /> 

Here's the class if it helps it'a just simple because I want to get it up and running before I do anything more complicated.

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;
}

with the same results each time.

The error being:

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.

I've restarted both Tomcat and the server itself and neither have helped. Any insight to this issue is much appreciated.

4

2 に答える 2

2

有効な Java Bean であるためには、クラスに引数のないコンストラクターが必要です (他のコンストラクターも使用できますが、少なくとも引数のないコンストラクターが必要です) Foldersそのようなコンストラクターをクラスに追加してみてください。

于 2013-02-27T14:59:28.237 に答える
0

JAR をビルド パスに含める必要があると思いますよね!?

于 2013-02-18T18:35:54.567 に答える