> Hi there,
> I have a query regarding xml and java:
[quoted text clipped - 10 lines]
> timeout="30"
> </FTP>
Just FYI, these are not attributes in the XML sense. You'd rather need
something like:
<FTP ftpDir="\somepath" timeout="30"/>
> So, I read them and put them into an object of type FTPSetting.java
> where I have these 2 attributes as instance variables and setter and
[quoted text clipped - 9 lines]
> ############
> Is this approach fine?
You'd probably want to add parameters to the setFtpDir and setTimeOut
methods, to accept the new values for the ftpdir and the timeout.
> Info: "The application is an RMI application."
>
[quoted text clipped - 10 lines]
> class that in turn calls the setFtpDir() of FtpSettings.java.
> Will this suffice to change the parameter value at runtime?
I don't see why not.
- Oliver
Tarun - 13 May 2006 01:14 GMT
hey Oliver,
thanks a lot for the response ...and yes, I realise the change I need
make to the xml file .. thanks a lot for pointing that out ....
well while this approach works fine I have another query ...
Is there any other way I can read these xml parameters to my
application .... i mean rather then storing them in java objects like
FtpSettings.java thru setter and getter methods ... is there any other
way that I can have these parameters read from the xml file into my
application .... some sort of properties !!!! well i am just guessing
this and I do not have any idea about the properties ... but i want to
know if i can have these parameters accessible in my server and that i
should be able to change them thru a client without having to restart
the server ....
thanks for the reply again ...
Oliver Wong - 13 May 2006 14:28 GMT
> Is there any other way I can read these xml parameters to my
> application .... i mean rather then storing them in java objects like
> FtpSettings.java thru setter and getter methods ... is there any other
> way that I can have these parameters read from the xml file into my
> application
For your application to actually act on the settings, they have to be in
memory somewhere. Whether the in-memory representation is a custom Java
object with setters and getters, or a hashmap or some other datastructure is
up to you.
- Oliver