Login Register

Error loading contents of dojo.require(...)

I'm able to get dojo working in a sandbox environment linking to dojo with relative path names. I'm having a problem getting it to work completely when in use inside of Struts/Tiles. I seriously doubt this makes any difference but I just can't seem to load any additional modules with dojo.require(...) without getting an error.

E.g., if I try 'dojo.require("dojo.parser")' I see the following error in firebug:

GET https://frisky.ecovate.com/cc/default/undefined./parser.js 404 (20ms)
Could not load 'dojo.parser'; last tried './parser.js'

I tried playing with the baseUrl parameter but that doesn't seem to be working or I'm not using it right. My djConfig currently looks like: djConfig="parseOnLoad: true" and I've tried:

djConfig="parseOnLoad: true, baseUrl: '${pageContext.request.contextPath}/js/dojo'" and "..../js/dojo/dojo"

where the ${...} resolves to my servlet context, in this case "/cc"

I know it loads the CSS and dojo.js files fine because I can see them in firebug (and it knows how to execute the .require(...) method).

We have a base JSP that uses tiles to include/import other JSP pages but the client side has no knowledge of this as the J/S isn't even parsed until the page is served up to the browser.

Any ideas?

--adam

More code needed...

There's something else going on because there's an 'undefined' in that URL for parser.js.

Could you paste in the relevant parts of your document head where it's failing? Include the script tag where you load dojo.js as well.

If you put it between <html></html>, the forum software will format it correctly.