You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Pranav <me...@yahoo.com> on 2008/07/22 02:44:19 UTC
Dojo javascript errors with ajax theme. please help
Hi,
I am using <s:head theme="ajax"/> in my jsp files. I have included everything as per struts2 docs. But when I launch the page in FireFox, they show me 404 errors for several javascript files.
Example are:
../struts/dojo/src/i18n/calendar/nls/en-us/gregorian.js
../struts/dojo/src/i18n/calendar/nls/en/gregorianExtras.js
../struts/dojo/src/i18n/calendar/nls/en-us/gregorianExtras.js
../struts/dojo/src/widget/nls/en/TimePicker.js
../struts/dojo/src/widget/nls/en-us/TimePicker.js
../mcpages/struts/dojo/src/widget/nls/en/DropdownTimePicker.js
../struts/dojo/src/widget/nls/en-us/DropdownTimePicker.js
When I opened the struts2-core-2.0.11.jar file that my project is using, I did not find these files at all. I am not using any of these components like date-time picker or calendar objects but for some reason dojo plugin tries to GET these files. This gives a lot of problem in our pre-prod system where firewalls and proxies are installed. Can someone please help me get rid of these errors? What will I have to do? I will really appreciate help from experts.
Thanks
Pranav
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
Re: Dojo javascript errors with ajax theme. please help
Posted by Jeromy Evans <je...@blueskyminds.com.au>.
Pranav wrote:
> Hi,
>
> I am using <s:head theme="ajax"/> in my jsp files. I have included everything as per struts2 docs. But when I launch the page in FireFox, they show me 404 errors for several javascript files.
> Example are:
> ../struts/dojo/src/i18n/calendar/nls/en-us/gregorian.js
> ../struts/dojo/src/i18n/calendar/nls/en/gregorianExtras.js
> ../struts/dojo/src/i18n/calendar/nls/en-us/gregorianExtras.js
> ../struts/dojo/src/widget/nls/en/TimePicker.js
> ../struts/dojo/src/widget/nls/en-us/TimePicker.js
> ../mcpages/struts/dojo/src/widget/nls/en/DropdownTimePicker.js
> ../struts/dojo/src/widget/nls/en-us/DropdownTimePicker.js
>
> When I opened the struts2-core-2.0.11.jar file that my project is using, I did not find these files at all. I am not using any of these components like date-time picker or calendar objects but for some reason dojo plugin tries to GET these files. This gives a lot of problem in our pre-prod system where firewalls and proxies are installed. Can someone please help me get rid of these errors? What will I have to do? I will really appreciate help from experts.
>
> Thanks
> Pranav
>
>
>
In Struts 2.0.x, the files are bundled in the jar under
org/apache/struts/static or somewhere nearby.
The are served by the struts filter only if the filter path enables it
(eg. /*) and if the property struts.serve.static=true (default true).
In a production system, it's a very good idea to extract the files and
serve them directly from Apache or your container as there'll be a
significant performance improvement (very significant if apache serves
them).
I'm not sure why it would be loading the timepicker and date picker if
you're not using them - check the html to see why there's a Requires
statement.
In a production system, a good idea to create a custom dojo profile (in
this case, for example, to remove locale files). It makes a massive
performance improvement by reducing the large number of GETs.
http://cwiki.apache.org/S2WIKI/creating-a-custom-dojo-profile-for-struts-20x.html
Hope that helps.
Jeromy Evans
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
Re: Dojo javascript errors with ajax theme. please help
Posted by Rubens <ru...@hotmail.com>.
In your web.xml ensure you have a filter-mapping defined for the
/struts/...<js files>. You need to make sure that a request to the
Javascript and CSS files defined in the struts jar file go thru the Struts 2
filter. That is, make sure you have something like this on your web.xml:
<filter-mapping>
<filter-name>struts2Filter</filter-name>
<url-pattern>/struts/*</url-pattern>
</filter-mapping>
If the request to your struts 2 dojo javascript files do not go thru the
Struts 2 filter, you will get 404 error when the browser attempts to
retrieve those files.
Rubens.
--
View this message in context: http://www.nabble.com/Dojo-javascript-errors-with-ajax-theme.-please-help-tp18580332p19850152.html
Sent from the Struts - User mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org