Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Exception creating bean of class com.user

 
Pramod Kumar
Ranch Hand
Posts: 40
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I have created a bean that doesn't extends ActionForm, and I am getting the following exception.

---------------------

javax.servlet.jsp.JspException: Exception creating bean of class com..User: {1}
at org.apache.struts.taglib.html.FormTag.initFormBean(FormTag.java:515)
at org.apache.struts.taglib.html.FormTag.doStartTag(FormTag.java:482)
at jsp_servlet._myusers.__userbody._jsp__tag0(__userbody.java:146)
at jsp_servlet._myusers.__userbody._jspService(__userbody.java:121)
at weblogic.servlet.jsp.JspBase.service(JspBase.java:34)

Is that compulsory that for every bean we have to extend ActionForm? With out ActionForm can we use beans for forms in struts? The class files are in classpath. Any idea?
 
Merrill Higginson
Ranch Hand
Posts: 4864
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you reference a JavaBean in a <form-bean> tag in a struts-config.xml file, it must have ActionForm somewhere in it's hierarchy of superclasses.

Your main ActionForm can reference other JavaBeans that do not extend ActionForm, but the main form bean associated with an action must extend ActionForm.

I saw something else in your stack trace that concerns me: "com..User" is not a valid fully qualified class name. Did you edit the stack trace before posting it? If not, check your config file and make sure that it's specified properly.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic