• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Exception creating bean of class

 
Ranch Hand
Posts: 115
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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,
 
Ranch Hand
Posts: 4864
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
alright thanks, i overlooked that.
 
He repaced his skull with glass. So you can see his brain. Kinda like this tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic