David,
Thanks for the great framework for validation.  I have found it
extremely useful and am glad to hear it is becoming
part of struts in the future.  I am working on some deployment and
maintenance issues and wondered if you had any 
suggestions based on your input below.

There are two issues:

1--------------------

First is keeping the xml files small and isolated for ease of
maintenance.  I was wondering about creating
a file called validators.xml that includes all the validators that I am
using in a project (Validator definitions and maybe the
javascript to go with it.)

I would then create a file for each form that I am validating that
contains the validation rules for each field.  

I could then create a validation.xml file that included all the above
files (Validator.xml and several formvalidation.xml files).  That would
allow us to work on validation rules for a set of forms independent of
the other forms.

Is this overkill?
How do you actually do an xml include?

2--------------------------
We have several non-struts applications and several separate isolated
struts applications.  We have one common javascript validation library
that is 
used for all projects.  If for example we had 2-nonstruts apps and 3
struts apps we would have to deploy 4 copies of the same javascript
code.  One for the 
non-struts apps and 3 for the struts apps since each struts app has a
validation.xml file containing the javascript as part of the file.

The scenario listed above would reduce the duplication to 2 since we
would now need one javascript library for the non-struts apps and one
validator.xml file for
the struts applications.

I sure would like to reduce that duplication to one.
It seems that the static and dynamic jsp references might do the trick
but I must admit I really don't understand it fully yet.  Also we don't
have jsp support for all
of the applications we deploy so it might present a packaging problem
as well.

I would appreciate anyone's input on this issue.  I am just trying to
reduce maint and support costs in the future as we deploy more and more
solutions that are struts based.

Thanks



Scott Ryan
Developer
First Bank Data Corporation
Work: (303) 235-1485
Cell:    (303 263-3044

>>> [EMAIL PROTECTED] 07/18/01 08:07PM >>>
If you look at the jsType.jsp, you will see that it is
referencing an external JavaScript file called
staticJavascript.jsp.  You could put other JavaScript
methods in that and call them from onclick, etc. 
Although I'm not sure if that is what you mean. 
Otherwise you could do an xml include.  I think the
JavaScript associated with a java method should be
with it in the xml file.

David

--- Scott Ryan <[EMAIL PROTECTED]> wrote:
> Yes the javascript is being generated.  I think the
> problem is that I
> used the validation.xml that comes with the latest
> release or your
> validator and some of it appears to not be
> compatible with Netscape
> version I am testing with.  Java script has the
> great benefit of failing
> but not indicating where the problem is.  
> 
> I stripped out all but the required and mask code
> and it works.  
> 
> I can now go through function by funtion and see
> which one is
> incompatible.
> 
> Is there any stratgy that would allow you to
> reference javascript that
> is in a library so that we could use some of the
> current javascript
> libraries we have today with out copying the code
> into the
> validation.xml.
> 
> My next challenge is to get the generated validation
> to work with the
> formatting javascript I currently have on the page. 
> This is currently
> causing some issues.
> 
> Thanks for the help.
> 
> Scott Ryan
> Developer
> First Bank Data Corporation
> Work: (303) 235-1485
> Cell:    (303 263-3044
> 
> >>> [EMAIL PROTECTED] 07/18/01 03:49PM >>>
> Do you see any JavaScript being generated in the
> html?
> 
> David
> 
> --- Scott Ryan <[EMAIL PROTECTED]> wrote:
> > I have now converted to the latest version of the
> > Validator and that
> > caused the server side validation to start working
> > but not the javascript client side doesn't work. 
> It
> > goes straight to
> > the server validation.  I double checked
> everything
> > mentioned in the documentation and in the previous
> > messages in this
> > list and everything appears ok.  The only things
> > I think I need is the onsubmit addition and the
> > javascript validator
> > tag.  
> > 
> > Any more suggestions.
> > 
> > Scott
> > 
> > Scott Ryan
> > Developer
> > First Bank Data Corporation
> > Work: (303) 235-1485
> > Cell:    (303 263-3044
> > 
> > >>> [EMAIL PROTECTED] 07/18/01 10:06AM >>>
> > The JavaScript part shouldn't have anything to do
> > with
> > the server side other than it uses the same object
> > in
> > application scope.  Does the name attribute of
> your
> > action (which matches the key the ActionForm is
> > stored
> > under) in the struts-config.xml the same as the
> form
> > element's name attribute?  
> > 
> >     <action    path="/registration"
> >               
> >
>
type="com.wintecinc.struts.example.validator.RegistrationAction"
> >                name="registrationForm"
> >                scope="request"
> >                validate="true"
> >                input="/registration.jsp">
> >        <forward name="success"             
> > path="/index.jsp"/>
> >     </action>
> > 
> >       <form    name="registrationForm">
> >       </form>
> > 
> > David
> > 
> > --- Scott Ryan <[EMAIL PROTECTED]> wrote:
> > > Yes I am extending ValidatorForm instead of
> > > ActionForm.  Did you mean
> > > ValidateForm or ValidatorForm.  
> > > 
> > > I originally commented out the validate method
> > that
> > > I had but after
> > > nothing happened I tried creating a validate
> > method
> > > that only called
> > > super.validate with the proper attributes but it
> > > returned an empty
> > > errors object.  
> > > 
> > > It almost appears that I have missed a flag
> > > somewhere.  It was easy to
> > > get the client side to work but unlike the rest
> of
> > > the user's I am
> > > having a problem getting the server side to fire
> > > correctly.  
> > > 
> > > I am going to try and remove the onsubmit from
> my
> > > jsp and see if the
> > > server side will fire then.
> > > 
> > > Thanks for your suggestions.
> > > 
> > > Scott Ryan
> > > Developer
> > > First Bank Data Corporation
> > > Work: (303) 235-1485
> > > Cell:    (303 263-3044
> > > 
> > > >>> [EMAIL PROTECTED] 07/18/01 08:50AM
> >>>
> > > Are you extending ValidateForm instead of
> > > ActionForm?
> > > 
> > > If you have a validate method in your form, be
> > sure
> > > to call
> > > super.validate().
> > > 
> > > Ryan
> > > 
> > > 
> > > 
> > > >>> [EMAIL PROTECTED] 07/18/01 08:53AM
> >>>
> > > I am trying to use the Validator extension for
> > > struts.   I have the
> > > client side functioning correctly and it works
> > > great.  I then go into
> > > Netscape and turn off java script and the server
> > > side checking is not
> > > firing.  Am I missing some configuration
> > parameter? 
> > > I even tried
> > > calling super.validate from a validate method
> > within
> > > my ActionForm and
> > > this returned no information either.  Any ideas
> on
> > > where I can look?
> > > 
> > > Thanks
> > > 
> > > Scott Ryan
> > > Developer
> > > First Bank Data Corporation
> > > Work: (303) 235-1485
> > > Cell:    (303 263-3044
> > 
> > 
> > __________________________________________________
> > Do You Yahoo!?
> > Get personalized email addresses from Yahoo! Mail
> > http://personal.mail.yahoo.com/ 
> 
> 
> __________________________________________________
> Do You Yahoo!?
> Get personalized email addresses from Yahoo! Mail
> http://personal.mail.yahoo.com/ 


__________________________________________________
Do You Yahoo!?
Get personalized email addresses from Yahoo! Mail
http://personal.mail.yahoo.com/

Reply via email to