Re: GWT Properties file configuration

224 views
Skip to first unread message

David

unread,
Oct 9, 2012, 10:06:19 AM10/9/12
to google-we...@googlegroups.com

One way to do this is to add your server's .properties values to the page in the form of a javascript map
<script type="text/javascript" language="javascript" >   
        prefetchedJSP["prop1"] =   "${prop1}"; 
        prefetchedJSP["prop2"] =   "${prop2}"; 
</script>

and then access those values in gwt with a com.google.gwt.i18n.client.Dictionary
dictionary.getDictionary("prefetchedJSP");


On Monday, October 8, 2012 3:33:50 AM UTC-4, Jayesh Patel wrote:

I am new to GWT, and facing one problem.

How we have .properties file for initial configuration at startup. I want to create one in GWT App.

Also, GWT has client and server package.

I want to setup the configuration at client package because all configuration belongs to client side.

My actual need,

I have one textArea which takes up only fixed number of characters and length is defined in my properties file like below.

So I have to read a properties file for validation.

my.properties

smsConstraintEnabled=true
smsConstraintCharLimit=160

I found few link but all are talking about properties file regarding Locale, I don't have any need on Locale side but need simple key-value configuration.

I want this file to be loaded at startup or at Entry point itself and then I can use it at any client package classes for my validation.

Thanks in advance.

Reply all
Reply to author
Forward
0 new messages