Hi Keith,
just about to try using the validator myself. If I get to frustration point like this, I sometimes grab the struts source and put some logging statements in it to make sure it's doing what it's meant to. If you're put off by the idea of dabbling with the struts source, don't be - it's a lead pipe cinch. Just copy the one relevant struts .java file to your source code including its directory tree, edit and recompile. I'm using tomcat and that always picks up my version of the file and ignores the one in struts.jar.


I assume you'd need to look at the ActionValidatorForm
Adam

Kamholz, Keith (corp-staff) USX wrote:
Just tried this.  The method is getting called, but isn't producing any
errors.
I believe I'm only using server side validations.

- Keith


-----Original Message----- From: David Graham [mailto:[EMAIL PROTECTED] Sent: Tuesday, June 24, 2003 12:10 PM To: Struts Users Mailing List Subject: RE: Damn Validator...


That looks ok to me. Override the validate() method in your ActionForm and see if it gets called. Then have it call the super.validate() method to see if the validator returns any errors. Does anything at all happen when you submit the form? Are you using both javascript and server side validations?

David

--- "Kamholz, Keith (corp-staff) USX" <[EMAIL PROTECTED]> wrote:

Sure thing, thanks for checking it out. Here's my validation.xml:


<?xml version="1.0" encoding="ISO-8859-1" ?>


<!DOCTYPE form-validation PUBLIC
         "-//Apache Software Foundation//DTD Commons Validator Rules
Configuration 1.0//EN"
         "http://jakarta.apache.org/commons/dtds/validator_1_0.dtd";>

<form-validation>

   <global>
   </global>

        <formset>
                <form name="ansm">
                        <field       property="numberType"
                                depends="required">
                            <arg0 key="app.label.numberType"/>
                        </field>
                        <field       property="typeDesc"
                                depends="required">
                            <arg0 key="app.label.numberType"/>
                        </field>
                </form>
        </formset>

</form-validation>



-----Original Message-----
From: David Graham [mailto:[EMAIL PROTECTED]
Sent: Tuesday, June 24, 2003 11:14 AM
To: Struts Users Mailing List
Subject: Re: Damn Validator...


Can you post the relevant form definition in validation.xml? I'm having a hard time downloading the attachment.

David


--- "Kamholz, Keith (corp-staff) USX" <[EMAIL PROTECTED]> wrote:


Hey everyone,
I posted recently regarding my issues with the Validator plugin.

There


were
a few suggestions, but I had already checked everything that was
mentioned.
I'm going crazy, I've been trying for a several days to get this thing
working, but have gotten nowhere.  I'm posting some of my code.  If
anyone
is willing to check it out to see if they notice any mistakes, I'd
really
appreciate it.

Here are a few snippets from my struts-config.xml :

 <form-beans>
        <form-bean name="ansm" type="com.moog.us.app.ans.data.AnsmItem"/>
        <form-bean name="ansa" type="com.moog.us.app.ans.data.AnsaItem"/>
 </form-beans>


<action path="/AddFormat" type="com.moog.us.app.ans.action.AddANSM" validate="true" name="ansm" scope="request" input="tiles.addFormat"/>

<message-resources parameter="ApplicationResources"/>

<plug-in className="com.moog.us.struts.AppStartupPlugin"/>

<plug-in className="org.apache.struts.tiles.TilesPlugin" >
<set-property property="definitions-config" value="/WEB-INF/tiles-defs.xml" />
<set-property property="moduleAware" value="true" />
<set-property property="definitions-parser-validate"
value="true" />
</plug-in>
<plug-in className="org.apache.struts.validator.ValidatorPlugIn">
<set-property
property="pathnames"

value="/WEB-INF/validator-rules.xml,/WEB-INF/validation.xml"/>
</plug-in>



I have the necessary messages in my ApplicationResources, and my form beans sublass ValidatorForm.

I've also attached my validation.xml and the JSP that uses the action
that
I've shown above.  If there are any other files that I should send as
well,
let me know.

I'm going nuts here! Any help would be greatly appreciated. Thanks!


- Keith




<<validation.xml>>

<<AddFormat.jsp>>


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

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


__________________________________
Do you Yahoo!?
SBC Yahoo! DSL - Now only $29.95 per month!
http://sbc.yahoo.com

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

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




__________________________________ Do you Yahoo!? SBC Yahoo! DSL - Now only $29.95 per month! http://sbc.yahoo.com

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

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




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



Reply via email to