Share SmartGWT /sc folder over several modules

I would like to point to http://jajatips.blogspot.com/2010/11/share-smartgwt-js-over-several-gwt.html where there is a method that works, but isn´t really optimal because it copies theme styles and other resources several times to all the modules. This is just an improvement to that approach.

Create a base GWT Module:

BaseGWTModule.gwt.xml


<module rename-to="basegwt">

<inherits name='com.google.gwt.user.User'/>
<inherits name='com.smartgwt.SmartGwtNoSmartClient'/>

</module>

Create a module for only serving smartgwt /sc folder:

SmartGWTResourcesModule.gwt.xml


<module rename-to='smartgwt'>
<inherits name='com.smartgwt.SmartGwt'/>
</module>

Create several modules like this one:

SmartGWTSampleModule.gwt.xml


<module rename-to="gwtmodule">

<inherits name='com.kprtech.gwt.BaseGWTModule'/>

<entry-point class='com.example.EntryPoint'/>

</module>

Then in the html use something like:

index.jsp


<script type="text/javascript" language="javascript" src="gwtmodule/gwtmodule.nocache.js"></script>
<script> var isomorphicDir = "smartgwt/sc/"; </script>

3 thoughts on “Share SmartGWT /sc folder over several modules”

Leave a Reply

Your email address will not be published. Required fields are marked *