I need to read database properties from server.xml and need this information on load of the page.How do I acheive it in GWT ?
A:
I am not sure if there is anything specific to GWT. But I guess you could use
Or if you use JSP, you could use the application
implicit object to get the ServletContext
and you can use getResourceAsStream
bdhar
2010-09-07 09:51:13
A:
In your onModuleLoad() call an RPC through a
DeferredCommand.addCommand(new Command() {
public void execute () {
getDBParameters();
}
}
where getDbParameters is a method that populates the values for you by calling an RPC.
See http://code.google.com/webtoolkit/doc/latest/DevGuideServerCommunication.html for how to communicate with server.
On the Server side just have your RPC return a HashMap of properties and read those.
Romain Hippeau
2010-10-04 09:58:22