I tested your patch and the following file works on all pages I included it on:
<%@ page language="java" %> <%-- sets document type to Javascript (addresses a bug in moz)--%> <%@ page contentType="application/x-javascript" %> <%@ include file="/WEB-INF/general/taglibs.jsp"%> <html:javascript dynamicJavascript="false" staticJavascript="true" />
I'm not sure about that page content type setting - might be legacy now.
Actually now the testing beast has raised its ugly head, are there any junit tests or anything like it for this type of thing in the struts project? I need to work out some automated tested for my present project. Clicking links is not my idea of automation.
Adam
On 03/09/2004 03:59 PM Joe Germuska wrote:
Adam:
If you're using Struts 1.2.0 or later (or some nightly builds shortly before that) and getting the <script> tags in your static JavaScript, that's a known bug:
http://nagoya.apache.org/bugzilla/show_bug.cgi?id=27239
I've been hoping that one of the bug reporters could test the patch I attached to that issue, since I never use static javascript. My other deadline has past, so I may have some time to work out a test myself, but I'd just as soon have someone who really uses it confirm that it's correct.
If you're talking about something else, forgive me -- but before February, the tag correctly worked in that the "script" tags were only emitted if dynamicJavascript was true.
Joe
I have put the javascript taglib in its own JSP so that I can call it up
with this:
<script src="staticjavascript.do" type="text/javascript">
The result of staticjavascript.do is meant to be pure javascript, like in a javascript file, without <script> HTML. If the script tags are there, then the browser can't read the javascript.
I changed the JavascriptValidatorTag source to get scriptLanguage="false" to turn off the addition of these tags.
It looks like the scriptLanguage attribute is only for putting the language="Javablah" in the HTML though.
I could put in another attribute, e.g. enclosingScriptTags.
Would you like me to submit an enhancement?
-- struts 1.1 + tomcat 5.0.16 + java 1.4.2 Linux 2.4.20 Debian
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
