Hi Pankaj, You can download the properties file from the client to the server using ClientContext.loadFile() method.
Please see the ULC Essentials Guide for more information on up/downloading files. >I have written two custome classes, one for client and other for server, >the client site class is working fine and on server class the dispatcher method is not working... What error are you getting? Moreover you have to make your server side proxy markUncollectable(), otherwise it will be garbage collected. Thanks and regards, Janak ----------------------------------------- Janak Mulani email: [EMAIL PROTECTED] url: http://www.canoo.com Beyond AJAX - Java Rich Internet Applications http://www.canoo.com/ulc ----------------------------------------- ________________________________________ From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Pankaj Patro Sent: Wednesday, February 13, 2008 4:03 PM To: [email protected] Subject: [ULC-developer] Reading a .properties file from client site In my application I need to read a .properties file from the client system , and the path of file is specified (C:\site.properties), for example at client system file should exist at C:\site.properties, after fetching the information from .properties file, I have to login to a particular site based on inforamation provided in .properties file. I have written two custome classes, one for client and other for server, the client site class is working fine and on server class the dispatcher method is not working... Can any one help me how to solve this, OR you can give me any better solution to read the .properties file from the client site. CLIENT SITE CUSTOME CLASS:- package com.tomax.ezlube.login.client; import java.io.FileInputStream; import java.io.IOException; import java.util.Properties; import com.ulcjava.base.client.UIProxy; public class UIClientProperties extends UIProxy { protected Object createBasicObject(Object[] args) { return new Properties(); } protected Properties getBasicProperties() { return (Properties) getBasicObject(); } public void updateClientProperties() { Properties clientProperties = getBasicProperties(); try { clientProperties.load(new FileInputStream("C:\\ezlube\\siteno\\siteno.properties")); } catch (IOException e) { e.printStackTrace(); } Object obj = clientProperties; updateStateULC("clientProperties", obj); } } -------------------------------------------------- SERVER SITE CUSTOME CLASS:- package com.tomax.ezlube.login.server; import java.util.Properties; import com.ulcjava.base.application.ULCProxy; import com.ulcjava.base.server.IDispatcher; public class ULCClientProperties extends ULCProxy { private ClientPropertiesUpdateListener fClientPropertiesUpdateListener; private Properties clientProperties; public Properties getClientProperties() { return clientProperties; } public void setClientProperties(Properties clientProperties) { this.clientProperties = clientProperties; } protected String typeString() { return "com.tomax.ezlube.login.client.UIClientProperties"; } public void execClientProperties() { invokeUI("updateClientProperties"); } public void updateClientProperties(Object obj) { Properties clientProperties = (Properties) obj; if (fClientPropertiesUpdateListener != null) { fClientPropertiesUpdateListener.clientPropertiesUpdated(obj); } } public void setClientPropertiesUpdateListener(ClientPropertiesUpdateListener listener) { fClientPropertiesUpdateListener = listener; } protected IDispatcher createDispatcher() { return new ULCClientPropertiesDispatcher(); } protected class ULCClientPropertiesDispatcher extends ULCProxyDispatcher { public final void updateClientProperties(Object obj) { ULCClientProperties.this.updateClientProperties((Properties) obj); } } public interface ClientPropertiesUpdateListener { public void clientPropertiesUpdated(Object clientProperties); } } -------------------------------------------------------------- HOW I INVOKES :_ ULCClientProperties clientProperties = new ULCClientProperties(); clientProperties.upload(); clientProperties.execClientProperties(); clientProperties.setClientPropertiesUpdateListener( new ULCClientProperties.ClientPropertiesUpdateListener() { public void clientPropertiesUpdated(Object properties) { System. out.println(" ********************** INSIDE DISPATCHER " + properties); siteNo = ((Properties)properties).getProperty("site"); } }); Thanks In advance Pankaj _______________________________________________ ULC-developer mailing list [email protected] http://lists.canoo.com/mailman/listinfo/ulc-developer
