Create a file called "staticJavascript.jsp" with the following content:
----------------------------------------------------------------
<%@ 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="http://jakarta.apache.org/struts/tags-html" prefix="html" %> <html:javascript dynamicJavascript="false" staticJavascript="true"/>
----------------------------------------------------------------
Then in pages that use the validator include this file in the <head>(as you alluded).
<head> <script language="Javascript1.1" src="staticJavascript.jsp"></script> ...
Now you can safely set the 'staticJavascript="false"' on the html:javascript tag throughout your regular JSPs.
There will still be some javascript on the page, but nowhere near as much as when the static javascript was printed.
Matt
Erik Weber wrote:
I found that the JavaScript generated by the Validator (Struts 1.1) added nearly 40Kb to the page download! (Perhaps there is a way to only download a script once and reuse it among pages? I have no idea.) I don't use JavaScript validation other than a simple blank field check.
Erik
Juan Salazar wrote:
Vic, Thanks. I have another question: I am testing for use Validators, javascript code travels from server to client in each form request... in a high traffic enviroment these could affects performance (network bandwidth). What do you think?
El jue, 18-11-2004 a las 11:42 -0600, Vic escribió:
The slowest part of J2EE is Data access.
With Struts, you have the capability to stress test the DAO layer by itself.
hth,
.V
Juan Salazar wrote:
Is there any performance issue using Struts (actions, tiles, validators,
etc)? (memory, network bandwith, etc)
I am using Struts for awhile, but need to known how to improve code.
Thanks in advance
--------------------------------------------------------------------- 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]