> -----Original Message----- > From: Nicholas L Mohler [mailto:[EMAIL PROTECTED] > Sent: Thursday, October 02, 2003 10:29 AM > To: Struts Users Mailing List > Subject: RE: Question about minimizing javascript loaded into web page > > > > > > > > > > > Saul, > > Thanks for the responses to the question. So you are suggesting that I > have a jsp that really has the sole purpose of acting as a javascript > container that will be usable on the client side, but not rendered to the > page. This may be a dumb question: is that possible? The jsp would use > the html:javascript tag to bring in the static javascript from the > validation framework.
Yes, the static javascripts will be available through referencing an external javascript file, which is actually rendered through: <html:javascript dynamicJavascript="false" staticJavascript="true" .... if you refer to my previous few emails to Brian's questions, you'll see what I mean. > > Is my understanding correct? Yes. Saul > Nick > > > > > > "Brian McSweeney" > <brian.mcsweeney@ To: "'Struts Users > Mailing > List'" <[EMAIL PROTECTED]> > aurium.net> cc: > Subject: RE: Question > about > minimizing javascript loaded into web page > 10/02/2003 11:00 > AM > Please respond to > "Struts Users > Mailing List" > > > > > > > Helps very much Saul. Cheers. > > Final dumb question: > > So is the result of this that only the javascript methods pertaining to > each jsp gets loaded into the page? > > If so, do you know why this isn't the default behaviour? > > Thanks, > Brian > > > -----Original Message----- > From: Yuan, Saul (TOR-ML) [mailto:[EMAIL PROTECTED] > Sent: 02 October 2003 13:46 > To: Struts Users Mailing List > Subject: RE: Question about minimizing javascript loaded into web page > > > > > Hi Saul, > > Could you explain this a little more. I'm interested too. > > > > For example, at the moment I'm just using the tag: > > > > <html:javascript formName="myForm" /> > > > > This brings down all the validator javascript in the page. > > > > 1) Is this what you mean by "static javascript"? > > yes > > > > > > 2) What exactly would you put in the staticJavascript.jsp page? > > Pulled from the struts example application, basically it's setting > dynamicJavascript="false" staticJavascript="true" > > staticJavascript.jsp: > --------------------------------------------- > > <%@ page language="java" %> > <%-- set document type to Javascript (addresses a bug in Netscape > according to a web resource --%> > <%@ page contentType="application/x-javascript" %> > > <%@ taglib uri="/WEB-INF/lib/struts-html.tld" prefix="html" %> > > <html:javascript dynamicJavascript="false" staticJavascript="true"/> > > --------------------------------------------- > > > > 3) What's the difference between static and dynamic javascript? > > (Probably a > > real dumb question :-) ) > > dynamic javascripts are generated based on the particular fields of your > jsp page, say, the validation error messages etc. The static javascripts > are those validation javascript functions as defined in the > validator-roles.xml file. > > > Hope this helps. > > Saul > > > > > > Am a bit confused :-) > > Thanks, > > Brian > > > > > > -----Original Message----- > > From: Yuan, Saul (TOR-ML) [mailto:[EMAIL PROTECTED] > > Sent: 01 October 2003 21:09 > > To: Struts Users Mailing List > > Subject: RE: Question about minimizing javascript loaded into web page > > > > If you don't want static javascript rendered inside your jsp page, you > > can set: > > > > staticJavascript="false" and have <script src="staticJavascript" ... > > reference the static part. > > > > Something like below: > > > > <html:javascript formName="yourForm" method="validateYourForm" > > dynamicJavascript="true" staticJavascript="false" /> > > > > <script language="Javascript1.1" src="staticJavascript.jsp"></script> > > > > > > Saul > > > > > > > > > > I apologize if this is a question that has already been addressed, > but > > > I've > > > not been able to find an answer... > > > > > > We have implemented the validation framework into our webapp and it > > works > > > well. We have noticed that all of the validation javascript is > loaded > > > into > > > the web page, even if the validation is not applied on the page. > The > > > loaded javascript can be over half of the loaded page's content. > > > > > > I think my javascript tag (struts-html:javascript) looks right. The > > > dynamic javascript is built as expected, but the static javascript > > just > > > brings in everything. Has anybody sen this before? > > > > > > I appreciate any guidance. > > > Nick > > > > > > > > > > > > > --------------------------------------------------------------------- > > > 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] > > > > > --------------------------------------------------------------------- > 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] > --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]