Hi

In your <html:javascript> tag set staticJavascript="false". This will remove 
all scripts except your validation. However you need to add a link to the 
generated scripts (in a .js file) in your .jsp.

Hermod

-----Original Message-----
From: Deepa Khetan [mailto:[EMAIL PROTECTED]
Sent: Monday, December 12, 2005 6:50 AM
To: Struts Users Mailing List
Subject: Re: Validator and Javascript


I dint understand how to copy the static javascript on the validator.xml to
another .js file? Can u please elaborate?

On 12/10/05, Laurie Harper <[EMAIL PROTECTED]> wrote:
>
> Tony Santinello wrote:
> > Hi,
> >
> > I'm using Struts 1.2.7 and I'm using commons-validator
> > to validate my forms.  Can someone tell me why
> > validator includes all the javascript functions when
> > rendering the jsp page?
> >
> > Even including javascript functions that I'm not using
> > in validation.xml, such as creditcard validation or
> > integer validation?
> >
> > Is there anyway to include just the javascript my jsp
> > needs and not all the extra javascript?
>
> There's two types of Javascript emitted by the validator framework:
> static and dynamic. The static script includes all the code that doesn't
> vary from form to form, whereas the dynamic stuff is dependent on the
> validations you've configured for the form.
>
> The html:javascript, by default, emits all the static code every time
> and generates additional dynamic code appropriate to the form. You can
> tell it not to emit the static Javascript at all (in which case you need
> to include it elsewhere on the page, directly or by reference), but you
> can't tell it to emit only a sub-set of the static code.
>
> Your best bet is to copy the static Javascript into a seperate .js file,
> include that in the head of your page, and turn it off in the
> html:javascript tag. Browser caching will then avoid the user having to
> download the static code everytime, which is one step better than
> inlining a sub-set of it.
>
> L.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>


* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *

This email with attachments is solely for the use of the individual or
entity to whom it is addressed. Please also be aware that the DnB NOR Group
cannot accept any payment orders or other legally binding correspondence with
customers as a part of an email. 

This email message has been virus checked by the virus programs used
in the DnB NOR Group.

* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *


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

Reply via email to