On 5/12/06, josh t <[EMAIL PROTECTED]> wrote:
Thanks Gary. So where should I be adding this method. I'm using struts 1.2.9.
This probably has something to do with it, as Harsh noted in his response.

You just need to ship the correct version of validator-rules.xml - the
correct one  being the one that comes with the version of Struts
you're using.

Just out of interest Struts 1.3.4 comes with the validator-rules.xml
distributed in the struts-core-1.3.4.jar.

Niall

Gary VanMatre <[EMAIL PROTECTED]> wrote:  It sort of looks like you are missing 
a formal parameter type in the methodParams.
The "Validator", second to last param is missing.

methodParams="java.lang.Object,
org.apache.commons.validator.ValidatorAction,
org.apache.commons.validator.Field,
org.apache.struts.action.ActionMessages,
org.apache.commons.validator.Validator,
javax.servlet.http.HttpServletRequest"

public static boolean validateRequired(Object bean, ValidatorAction va, Field 
field, ActionMessages errors, Validator validator, HttpServletRequest request)

Bad error message regardless....

Gary
-------------- Original message --------------
From: "Chaudhary, Harsh"

> My first thought was that you might be using an action as you validation
> key i.e., in validation.xml, instead of:
>
>

>
> you had:
>
>
>
> But this is not the case. So, I can't really tell why this is happening.
>
> Harsh.
>
> -----Original Message-----
> From: josh t [mailto:[EMAIL PROTECTED]
> Sent: Friday, May 12, 2006 3:47 PM
> To: Struts Users Mailing List
> Subject: RE: extending ValidationForm instead of ValidatorActionForm
>
>
> Sure. Here is the relevent section of my validation.xml and
> struts-config.xml. Note that this error only happens when I use
> ValidationForm. And I have no clue what that excpetion is! Any
> thoughts?
>
> From struts-config.xml
>
> > type="com.pac.its.action.form.LoginForm"/>
>
> > type="com.pac.its.action.security.LoginAction"
> name="loginForm"
> scope="request"
> validate="true"
> input="/WEB-INF/pages/login.jsp">
>
>
>
>
>
> From Validation.xml:
>
>
>
>
>
>
>

>
> My Validator-rule.xml
>
>
>
>
> > classname="org.apache.struts.validator.FieldChecks"
> method="validateRequired"
> methodParams="java.lang.Object,
> org.apache.commons.validator.ValidatorAction,
> org.apache.commons.validator.Field,
> org.apache.struts.action.ActionMessages,
> javax.servlet.http.HttpServletRequest"
> msg="errors.required"/>
>
>
>
>
>
>
>
> "Chaudhary, Harsh" wrote:
> Could you also include of you validation.xml and struts-config.xml?
>
> Harsh.
>
> -----Original Message-----
> From: josh t [mailto:[EMAIL PROTECTED]
> Sent: Friday, May 12, 2006 2:38 PM
> To: user@struts.apache.org
> Subject: extending ValidationForm instead of ValidatorActionForm
>
>
> When my form extends Strut's ValidationForm instead of
> ValidatorActionForm, I get the following exception when my form gets
> loaded for the first time. Any idea what this is? Also, I've copied my
> sample form here. Please let me know what I'm doing wrong. Many Thanks!
>
> MY Form (Do I need the validate method here? ):
>
>
> import javax.servlet.http.HttpServletRequest;
> import org.apache.struts.action.ActionErrors;
> import org.apache.struts.action.ActionMapping;
> import org.apache.struts.validator.ValidatorForm;
>
> public class LoginForm extends ValidatorForm {
>
> private String password;
>
> public String getPassword() {
> return password;
> }
> public void setPassword(String password) {
> this.password = password;
> }
>
> public ActionErrors validate(ActionMapping mapping,
> HttpServletRequest
> request) {
> return super.validate(mapping, request);
>
> }
>
> }
>
> Exception is:
> 2006-05-12 11:39:12,129 [HttpRequestHandler-1635615] ERROR
> org.apache.struts.validator.ValidatorForm.validate - org.apache.s
> truts.validator.FieldChecks.validateRequired(java.lang.Object,
> org.apache.commons.validator.ValidatorAction, org.apache.commo
> ns.validator.Field, org.apache.struts.action.ActionMessages,
> javax.servlet.http.HttpServletRequest)
> org.apache.commons.validator.ValidatorException:
> org.apache.struts.validator.FieldChecks.validateRequired(java.lang.Objec
> t, o
> rg.apache.commons.validator.ValidatorAction,
> org.apache.commons.validator.Field,
> org.apache.struts.action.ActionMessages, jav
> ax.servlet.http.HttpServletRequest)
> at
> org.apache.commons.validator.ValidatorAction.loadValidationMethod(Valida
> torAction.java:627)
> at
> org.apache.commons.validator.ValidatorAction.executeValidationMethod(Val
> idatorAction.java:557)
> at
> org.apache.commons.validator.Field.validateForRule(Field.java:811)
> at org.apache.commons.validator.Field.validate(Field.java:890)
> at org.apache.commons.validator.Form.validate(Form.java:174)
> at
> org.apache.commons.validator.Validator.validate(Validator.java:367)
> at
> org.apache.struts.validator.ValidatorForm.validate(ValidatorForm.java:11
> 0)
> at
> com.raytheon.its.action.form.LoginForm.validate(LoginForm.java:37)
> at
> org.apache.struts.action.RequestProcessor.processValidate(RequestProcess
> or.java:927)
> at
> org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:
> 204)
> at
> org.apache.struts.action.ActionServlet.process(ActionServlet.java:1196)
> at
> org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:414)
> at
> javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
> at
> javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
> at
> com.evermind.server.http.ServletRequestDispatcher.invoke(ServletRequestD
> ispatcher.java:765)
> at
> com.evermind.server.http.ServletRequestDispatcher.forwardInternal(Servle
> tRequestDispatcher.java:317)
> at
> com.evermind.server.http.HttpRequestHandler.processRequest(HttpRequestHa
> ndler.java:790)
> at
> com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:
> 270)
> at
> com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:
> 112)
> at
> com.evermind.util.ReleasableResourcePooledExecutor$MyWorker.run(Releasab
> leResourcePooledExecutor.java:186)
> at java.lang.Thread.run(Thread.java:536)
>
>
>
>
> ---------------------------------
> New Yahoo! Messenger with Voice. Call regular phones from your PC and
> save big.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>
>
>
> ---------------------------------
> Talk is cheap. Use Yahoo! Messenger to make PC-to-Phone calls. Great
> rates starting at 1¢/min.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>


---------------------------------
Yahoo! Messenger with Voice. Make PC-to-Phone Calls to the US (and 30+ 
countries) for 2¢/min or less.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to