Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Exception creating bean of class

 
lynn fann
Ranch Hand
Posts: 115
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 4864
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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")
 
lynn fann
Ranch Hand
Posts: 115
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
alright thanks, i overlooked that.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic