PDA

View Full Version : .properties file in GXT



catalin.ciobanu
21 Sep 2011, 11:39 PM
Hi guys I am using GXT with an external servlet and I'd like to use a properties file to specify servlet's address.
It is possible somehow ? As we don't have any access to the file system, it is something like this directly implemented in GXT ?

I thought it would be possible to specify my address somewhere in the xxxxx.gwt.xml file but I don't see any possibility.

Please help.

micgala
22 Sep 2011, 1:37 AM
Hi. I file in the file system you cannot read.
But, you can read a properties file deployed in your webserver with your client code.
For that, use GWT's RequestBuilder class for reading the content of the file.

catalin.ciobanu
22 Sep 2011, 1:43 AM
But, you can read a properties file deployed in your webserver with your client code.
For that, use GWT's RequestBuilder class for reading the content of the file.

Do you mean to make a request to my client code with the url like:

http://localhost:8080/myGxtApp/myFile.properties ?
Will this work ?:)

micgala
22 Sep 2011, 1:49 AM
Yes. By using RequestBuilder you can read that file contents.

catalin.ciobanu
22 Sep 2011, 2:09 AM
It works, thanks !