0

I have a problem with path to javascript in my GWT html.

I get: WARNING: No file found for: /smartajax/libs/historyjs/history.html4.js and more like this

File exists in my war/html1 dir.

It happens only if script like this above is called not from my Html1.html, but from other script that is in public (its not declared in html by <script type="text/javascript" ...>

 - public_res
  - smartajax
     - libs
         - historyjs


 - war
  - html1
     - smartajax
         - libs
             - historyjs

<script type="text/javascript" src="html1/smartajax/load.smartajax.js"></script>

How to solve this?

userbb
  • 2,148
  • 5
  • 30
  • 53

2 Answers2

0

You should ideally place all your third party scripts in same relative folder.

1) All in public/thirdparty
2) All in war/thirdparty
appbootup
  • 9,537
  • 3
  • 33
  • 65
0

Your gwt public resource folder is compiled into your module's folder, and not war base directory. It will be compiled into war/module_name/html1/smartajax/... So, instead of using relative uris, how about absolute uris?

GWT.getHostPageBaseURL() -> Base url for html page, http://x.y/

GWT.getModuleBaseURL() -> Base url for gwt module, http://x.y/module_name/

Ajax
  • 2,465
  • 23
  • 20