Read properties file at client side in gwt mvp4g

2.5k views Asked by At

I am using Mvp4g in gwt and i want to read properties file but if i add resourcebundle code its giving me exception java.lang.RuntimeException: Deferred binding failed for 'com.mvp4g.client.Mvp4gModule' (did you forget to inherit a required module?) but if i remove resourcebundle code its working fine . Is there any way to do that.

ResourceBundle rb = ResourceBundle.getBundle("com.opptin.client.socialsite");
String siteUrl = rb.getString("mode");

thanks

1

There are 1 answers

2
Tim On

java.util.ResourceBundle is not supported by the GWT compiler (if you want to know which Java APIs are emulated, have a look at the JRE Emulation Reference).

To use properties on the GWT client side, you can use com.google.gwt.i18n.client.Constants. An alternative is to pick JavaScript variables directly from the host page by com.google.gwt.i18n.client.Dictionary.