This was originally posted to the Struts user list. I was asked to post it here as well as it appears to be a dojo issue.
I'm using Struts 2.0.11 and it seem with Firefox 3 only there are rendering issues on pages where I have . I can see the page load fully and there is a quick flash of the browser and then a blank page with FF3 stuck in a loading state.
On certain pages I have made it theme=xhtml which solves the problem but some pages in my application have a which requires the ajax theme
Has anyone else seen this type of behavior or know of a work around?
Firebug consistantly displays the error as
dojo is not defined document.write(type='text/java...l_omit_module_check = false;"); ** NOTE: the document.write should have a script tag in it - but it keeps getting removed when I post the message
This always appears right after about 30+ .js files are loaded and immediately after ResizeHandle.js is loaded
Thanks in advance
G-

same here
I too have this problem, One thing I noticed is that when I access the applicaton locally(the server is within my subnet) the problem does not appear, but when I access it via the internet then I can reproduce the problem. This leads me to think that this maybe a timing issue such as an event firing prematurely even if a needed dojo js script is not yet fully loaded.
Another thing I expereinced is that when you get to the blank page stuck in a loading state, just click on the browser's back button and viola you get the desired page fully rendered. Do you get this behaviour too?
Hope that this gets fixed soon...
Thanks,
Re: Firefox 3 and struts theme="ajax"
I notice the same thing with the back button. According to some people in the Struts user group it's because of a new security setting in Firefox 3. Here's the link they pointed me to
http://dojotoolkit.org/support/faq/why-does-dojo-fail-load-file-urls-fir...
The solution is unreasonable considering you are asking users to lower a security level in FF3.
Hope that helps,
G-
Well, I still don't get it.
Well, I still don't get it. If this is attributed to a security setting then, why does it sometimes succeed?
Fix found
Ehhh no that guy is wrong.
I am not sure what the exact problem is, but it has to do with the way that browser_debug.js gets processed. One would think that this file would only get pulled in when the head tag attribute debug=true, but one would be wrong in that situation.
The "correct" way to fix this bug is to supply your own template for the head tag which will make the dojo attribute debugAtAllCosts respect the head debug flag.
To do this,
1. create a file named head.ftl in your simple templates directory. ( ie $classpath/template/simple/head.ftl)
2. Paste this text into it:
<script language="JavaScript" type="text/javascript"> // Dojo configuration djConfig = { baseRelativePath: "<@s.url includeParams='none' value='/struts/dojo' includeParams="none" encode='false'/>", isDebug: ${parameters.debug?default(false)}, bindEncoding: "${parameters.encoding}", debugAtAllCosts: ${parameters.debug?default(false)}, // not needed, but allows the Venkman debugger to work with the includes }; </script> <script language="JavaScript" type="text/javascript" src="<@s.url includeParams='none' value='/struts/dojo/dojo.js' includeParams="none" encode='false'/>"></script> <script language="JavaScript" type="text/javascript" src="<@s.url includeParams='none' value='/struts/simple/dojoRequire.js' includeParams="none" encode='false'/>"></script>3. Refresh your page, the bug should be gone as long as the struts head tag does not have debug set to true.
Of course, you will have to turn debugging on to get firebug happy, but I believe that that is an acceptable compromise.
Tested, fix definitely
Tested, fix definitely works.
Problem in IE
Hi,
I am new to struts and dojo tool kit. I got the same page load problem in FF and was able to solve using the above mentioned head.ftl
Now this is affecting the IE. In IE I am getting javascript errors. I tried removing the head.ftl then there are no javascript errors in IE.
I am unable to figure out what is the exact problem.
Please any one can suggest me on this..
thanks,
sorry for the earlier problem
There is a comma at the end of the line. In hurry I was unable to find that.
debugAtAllCosts: ${parameters.debug?default(false)},
after removing the comma the javascript error gone.
Please forgive my mistake.
Tis Ok. Glad I could be of
Tis Ok. Glad I could be of help. This was a bear to find for me and I am glad that other people find it helpful.
A bit of warning, Struts 2.1 is going to break much of the Ajax functionality of Struts 2.0. You may wish to start from there.