File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Struts and the fly likes Exception creating bean of class Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Exception creating bean of class" Watch "Exception creating bean of class" New topic
Author

Exception creating bean of class

lynn fann
Ranch Hand

Joined: Oct 15, 2006
Posts: 115
hi all, i having the above error. can someone tell me what i should do?

struts-config.xml
<form-bean name="contentForm"
type="com.strutsExample.formbean.ContentForm"/>

<action-mappings>
<action path="/ContentAction"
name="contentForm"
scope="request"
input="/insert.jsp"
parameter="action"
type="com.strutsexample.action.ContentAction">
<forward name="success" path="/list.jsp"/>
</action>
</action-mappings>


public class ContentForm extends ActionForm{

private String title;
private String content;
private String name;
private String file;

public ContentForm() {
}
public String getTitle() {
return title;
}
public void setTitle(String title) {
this.title = title;
}
public String getContent() {
return content;
}
public void setContent(String content) {
this.content = content;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getFile() {
return file;
}
public void setFile(String file) {
this.file = file;
}
}

anything that is wrong?

thanks,
Merrill Higginson
Ranch Hand

Joined: Feb 15, 2005
Posts: 4864
about ninety percent of the time, this exception happens because of a spelling error, and this appears to be no exception.

For your form bean you define the package as com.strutsExample.formbean for your action class you define the package as com.strutsexample.action. I suspect that due to this inconsistency, the package name for your form bean is spelled wrong, or at least has the wrong case. Shouldn't it be com.strutsexample.formbean ? (with lower case "e")


Merrill
Consultant, Sima Solutions
lynn fann
Ranch Hand

Joined: Oct 15, 2006
Posts: 115
alright thanks, i overlooked that.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Exception creating bean of class
 
Similar Threads
action class not being called.
error while running my struts application
<c:url param passes null always
struts file uploading problem
problem in tiles application