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 Bean not Found : DynaValidatorForm Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Bean not Found : DynaValidatorForm" Watch "Bean not Found : DynaValidatorForm" New topic
Author

Bean not Found : DynaValidatorForm

Robert Hogan
Greenhorn

Joined: Apr 09, 2007
Posts: 4
I am attempting in implement DynaValidatorForm forms in a small scale Struts application. When I run the jsp making reference to a dynavalidatorform bean I get a javax.servlet.jsp.JspException exception with a message "Cannot find bean: .... in any scope".

As this is the first step in my conversion process, the application defs are VERY simple (see below).

One curious thing about this is if I change the type attribute in the form-bean definition to a class that does not exist like "this.class.does.not.exist" I get EXACTLY the same problem ... which leads me to think that the DynaValidatorForm class cannot be either located or loaded. However (tomcat V5 environment), I can see the referenced class in the WEB-INF/lib/struts-core-1.3.5.jar file?

This is probably some simple oversight on my part, but being new to DynaLalidator's is probably making me blind to the problem. This is driving me nutty. Can anyone offer help?

many thanks




from struts-config.xml

<form-bean name="logonFormBean" type="org.apache.struts.validator.DynaValidatorForm">
<form-property name="errorsimulate" type="java.lang.String" />
<form-property name="email" type="java.lang.String" />
<form-property name="password" type="java.lang.String" />
</form-bean>

<action path="/action/logon"
type="com.simbio.sonar.instructor.action.LogonAction"
name="logonFormBean"
scope="request"
validate="true"
>
<forward name="initial" path="/pages/Logon.jsp"/>
<forward name="success" path="/pages/Welcome.jsp"/>
<forward name="error" path="/pages/Logon.jsp"/>
<forward name="forgotten" path="/pages/Forgotton.jsp"/>
</action>
Merrill Higginson
Ranch Hand

Joined: Feb 15, 2005
Posts: 4864
What you've shown us looks OK. Now show us your JSP. Of particular interest is the <html:form> tag and any other tags that make reference to the form bean. Nine times out of ten, this error is the result of a simple spelling error. Did you spell the action path and/or bean name correctly in the JSP?


Merrill
Consultant, Sima Solutions
Robert Hogan
Greenhorn

Joined: Apr 09, 2007
Posts: 4
Merrill

Thank you for the reply ... which was right on target. I was so sure the problem was in the XML that I never closely examined the JSP. The kick to the head that you provided is what got me to look at the JSP and find the problem (which was a html:form tag referncing the wrong action and therefore the wrong bean).
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Bean not Found : DynaValidatorForm
 
Similar Threads
Cannot find ActionMappings or ActionFormBeans collection error
I am getting error when starting Tomcat .How can I rectify it?
problem in getting data from request
Struts validation framework- for single form, multiple actions
accessing dynaactionform in action class