Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SmartGWT does not resolve resources based on module base URL #36

Closed
GoogleCodeExporter opened this issue Apr 22, 2015 · 15 comments
Closed

Comments

@GoogleCodeExporter
Copy link

See discussion in http://forums.smartclient.com/showthread.php?t=3128.

When deploying a SmartGWT application in a different location than the
respective host page, GWT loads SmartGWT relative to the module base URL,
but SmartGWT tries to load resources relative to the context URL.
Example: 
Servlet delivering the host page: /appContext/appController.form
SmartGWT/GWT application resides in : /appContext/gwt-files/...
GWT loads SmartGWT in /appContext/gwt-files/sc/....
SmartGWT tries to locate resources in /appContext/sc/...

Original issue reported on code.google.com by christia...@ect-telecoms.de on 8 Dec 2008 at 3:33

@GoogleCodeExporter
Copy link
Author

Original comment by sanjiv.j...@gmail.com on 9 Dec 2008 at 1:18

  • Changed state: Accepted

@GoogleCodeExporter
Copy link
Author

also see http://forums.smartclient.com/showthread.php?t=3664

Original comment by sanjiv.j...@gmail.com on 16 Jan 2009 at 7:51

@GoogleCodeExporter
Copy link
Author

AN UGLY WORKAROUND:
I had to add the following to my host html file before the nocache.js script 
tag.
<script>
  var isomorphicDir = "[MODULE_NAME]/sc";
</script>

Where MODULE_NAME is the module you are building.


SEE #139


Original comment by atifijaz...@gmail.com on 2 Mar 2009 at 9:38

@GoogleCodeExporter
Copy link
Author

I took a quick look at the thread on
http://forums.smartclient.com/showthread.php?t=3664 and looks like my 
workaround is
not so nasty after all.  

Please note that this is NOT A SOLUTION.  This will have to be addressed so 
that GWT
1.6 can be used with smartgwt 1.0.

Original comment by atifijaz...@gmail.com on 2 Mar 2009 at 9:47

@GoogleCodeExporter
Copy link
Author

Issue 139 has been merged into this issue.

Original comment by sanjiv.j...@gmail.com on 10 Apr 2009 at 3:33

@GoogleCodeExporter
Copy link
Author

Add 

<script>
  var isomorphicDir = "[MODULE_NAME]/sc";
</script>

to your host html file.

Original comment by sanjiv.j...@gmail.com on 5 May 2009 at 4:32

  • Changed state: Fixed
  • Added labels: SmartGWT-1.0b3

@GoogleCodeExporter
Copy link
Author

I'm using SmartGWT-1.2 and have renamed my module to "mymodule" but I had to add

<script>
  var isomorphicDir = "mymodule/sc";
</script>

to my host html file. I thought this was fixed?

Original comment by cheng....@gmail.com on 23 Aug 2009 at 6:35

@GoogleCodeExporter
Copy link
Author

cheng, that works in SmartGWT 1.2. Have a look at  the Hello world sample for 
GWT 1.6 that is shipped in the 
SmartGWT distribution and compare your with this to see what you're doing 
incorrectly.

Original comment by sanjiv.j...@gmail.com on 23 Aug 2009 at 6:38

@GoogleCodeExporter
Copy link
Author

I checked the source at
http://code.google.com/p/smartgwt/source/browse/trunk/samples/helloworld-1.6/war
/HelloWorld.html:

    <title>SmartGWT Hello World</title>

    <!-- IMPORTANT : You must set the variable isomorphicDir to [MODULE_NAME]/sc/ so
that the SmartGWT resource are 
          correctly resolved -->        
        <script> var isomorphicDir = "helloworld/sc/"; </script> 

    <script type="text/javascript" language="javascript"
src="helloworld/helloworld.nocache.js"></script>


So the fix is to define the isomorphicDir? I thought that the fix meant that it 
was
not longer necessary to define such variable

Original comment by cheng....@gmail.com on 23 Aug 2009 at 7:05

@GoogleCodeExporter
Copy link
Author

sorry, I misunderstood. Yes, you still need to add the variable.

Original comment by sanjiv.j...@gmail.com on 23 Aug 2009 at 7:08

@GoogleCodeExporter
Copy link
Author

Cool, many thanks!

Original comment by cheng....@gmail.com on 23 Aug 2009 at 7:14

@GoogleCodeExporter
Copy link
Author

Even in SmartClient 2.0 this workaround still seems to be necessary. The script 
to set 
the isomorphicDir MUST come before the GWT no-cache script!

Original comment by doogie...@gmail.com on 21 Dec 2009 at 10:36

@GoogleCodeExporter
Copy link
Author

Setting isomorphicDir variable doesn't solve the problem and resource is loaded 
relative to context URL and causes problems! What is workaround?  

Original comment by emoroz...@gmail.com on 21 Sep 2010 at 11:34

@GoogleCodeExporter
Copy link
Author

How come this is a medium priority issue. It's a huge one!

Original comment by nielsba...@gmail.com on 5 Nov 2010 at 4:32

@GoogleCodeExporter
Copy link
Author

With having a look on the html resources, this works for me:

<script>
  var isomorphicDir = "sc/";
</script>

Iused the totsp archetype and SmartClientGWT 2.4

Original comment by ame...@gmail.com on 7 Feb 2011 at 11:57

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant