Tuesday, 15 February 2011

jsp - Java Bean not being recognised -



jsp - Java Bean not being recognised -

i have created java bean next information:

package: com.mysite

class: folders

the file located in root/web-inf/classes/com/mysite/folders.class

and phone call is:

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

here's class if helps it'a simple because want , running before 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() { homecoming accountnumber; } public void setaccountnumber(string accountnumber) { this.accountnumber = accountnumber; } public string getfoldername() { homecoming foldername; } public void setfoldername(string foldername) { this.foldername = foldername; } public arraylist<string> getfoldernames() { homecoming foldernames; } public void setfoldernames(arraylist<string> foldernames) { this.foldernames = foldernames; } public string getgroupname() { homecoming groupname; } public void setgroupname(string groupname) { this.groupname = groupname; } public arraylist<string> getgroupnames() { homecoming 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 same results each time.

the error being:

severe: servlet.service() servlet jsp threw exception org.apache.jasper.jasperexception: /custom/folders.jsp(13,0) value usebean class attribute com.mysite.folders invalid.

i've restarted both tomcat , server , neither have helped. insight issue much appreciated.

in order valid java bean, class must have no-argument constructor (it can have other constructors well, must have @ to the lowest degree no-argument one). seek adding such constructor folders class.

java jsp javabeans

No comments:

Post a Comment