Hi GWT guys,

Good day to all.

I am working on GWT now and trying to learn every corner of the project. At 
this point of time, I am struck up with configuring the .properties file.

I am using a .properties file in my client package. In that I have given a 
server name defined to a variable(ipAddress1).

I have used interface in the client package and used annotations in that to 
get that server name.

This interface i have used in my client application to get the server name 
from .properties file.

1) Now here, If I need to change the server name in future, I need to 
change in .properties file as well as Interface. Its not a good practice. 
How can I handle this situation?

2) How can I configure the .properties file to my whole project?

3) If the above way is the only process to get all the data in .properties 
file, how can I handle that without using the Constants package in the 
interface?

Here is my sample code:

.properties
---------------

ipAddress1 = "dtjhbtibadm";

Const_Interface.java
-----------------------------

import com.google.gwt.i18n.client.Constants;

public interface Const_Interface extends Constants{
@DefaultStringValue("dtjhbtibadm")
String ipAddress1();

}

Client App:
---------------

public class MyApp implements EntryPoint{
..............
..............
public void onModuleLoad() {
.............
.............
public void onClick(ClickEvent event) {
    Const_Interface cons_intr = (Const_Interface) 
GWT.create(Const_Interface.class);
    java.lang.String ipAddress1 = cons_intr.ipAddress1();
            java.lang.String ipAddress= ipAddress1;

*.gwt.xml
-------------

<inherits name="com.google.gwt.i18n.I18N"/>

Jars:
------
gwt-user 1.6.4.jar


Thanks in advance,

Sampath Girish M

            

 

-- 
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/google-web-toolkit/-/NWT0JoLNRgcJ.
To post to this group, send email to google-web-toolkit@googlegroups.com.
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.

Reply via email to