File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
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

Bean not Found : DynaValidatorForm

Robert Hogan

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" />

<action path="/action/logon"
<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"/>
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?

Consultant, Sima Solutions
Robert Hogan

Joined: Apr 09, 2007
Posts: 4

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:
subject: Bean not Found : DynaValidatorForm
It's not a secret anymore!