You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by snehalkgandhi <sn...@jpmchase.com> on 2008/02/22 21:49:31 UTC

Struts2 & AJAX config errors

Hi,
   I'm using the Struts2 and trying to integrate it with AJAX. I've given
the following : 

MyJSP File : 


and when i submit my page, it gives me a javascript error saying dojo is
undefined. I tried to debug with Firebug and below is the error that i'm
getting. After the javascript errors the page submits and populates the
output in a new page. I also have my struts2.0.11.jar in the path. Is there
anything that I'm missing out. Please let me know..

Thanks
Snehal

Firebug debug Errors : 
missing ; before statement
[Break on this error] Error 404: SRVE0190E: File not found:
/struts/dojo/dojo.js\n
dojo.js (line 11191)
dojo is not defined
[Break on this error] dojo.hostenv.writeIncludes(); // not needed, but
allows the Venkman debugger to ...
dojoRequire.js (line 22)
missing ; before statement
[Break on this error] Error 404: SRVE0190E: File not found:
/struts/ajax/dojoRequire.js\n
dojoRequire.js (line 36)
missing ; before statement
[Break on this error] Error 404: SRVE0190E: File not found:
/struts/CommonFunctions.js\n
-- 
View this message in context: http://www.nabble.com/Struts2---AJAX-config-errors-tp15641636p15641636.html
Sent from the Struts - User mailing list archive at Nabble.com.

Re: Struts2 & AJAX config errors

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/Struts2---AJAX-config-errors-tp15641636p19850158.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


Re: Struts2 & AJAX config errors

Posted by Dave Newton <ne...@yahoo.com>.
What does your filter mapping look like?

Dave

--- snehalkgandhi <sn...@jpmchase.com> wrote:

> 
> Hi,
>    I'm using the Struts2 and trying to integrate it with AJAX. I've given
> the following : 
> 
> MyJSP File : 
> 
> 
> and when i submit my page, it gives me a javascript error saying dojo is
> undefined. I tried to debug with Firebug and below is the error that i'm
> getting. After the javascript errors the page submits and populates the
> output in a new page. I also have my struts2.0.11.jar in the path. Is there
> anything that I'm missing out. Please let me know..
> 
> Thanks
> Snehal
> 
> Firebug debug Errors : 
> missing ; before statement
> [Break on this error] Error 404: SRVE0190E: File not found:
> /struts/dojo/dojo.js\n
> dojo.js (line 11191)
> dojo is not defined
> [Break on this error] dojo.hostenv.writeIncludes(); // not needed, but
> allows the Venkman debugger to ...
> dojoRequire.js (line 22)
> missing ; before statement
> [Break on this error] Error 404: SRVE0190E: File not found:
> /struts/ajax/dojoRequire.js\n
> dojoRequire.js (line 36)
> missing ; before statement
> [Break on this error] Error 404: SRVE0190E: File not found:
> /struts/CommonFunctions.js\n
> -- 
> View this message in context:
> http://www.nabble.com/Struts2---AJAX-config-errors-tp15641636p15641636.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