Take the 2-minute tour ×

I'm creating a web application on GWT. I'm using MVP pattern with activities and places. I have a xml config file containing some parameters to be used by the application. Content of this xml file is sent to the client using HttpRequest; I'm using a singleton class to hold the information from the xml file.

Right now, the application is getting the data when the user starts the application in the home page, that is working well. Now, since I'm using activities and places, a user can bookmark a page and starts the application in any other page (Place). And here comes the problem: Since I'm using some of the information from the xml file to set some ui widgets, I have to check if the xml config file was read and the application already has the parameters (I do this by checking the singleton class). But the xml file is read by using an HttpRequest, so I got errors 'cause the application needs some parameters to initialize some ui widgets, but these parameters aren't ready on time.

I was thinking on using an synchronous request to fix the problem, but it seems complicated and not recommendable to do that. So, I'd like to hear some other suggestions.


share|improve this question
This is a programming related question. You are likely to get an answer on stackoverflow –  Sripathi Krishnan Nov 14 '11 at 15:41
@SripathiKrishnan There is no specific code error in this question, so it's not suitable for Stack Overflow as written. –  Anna Lear Nov 14 '11 at 16:12
add comment

2 Answers

Could you use a dynamic host page to seed the page with the configuration parameters? See the GWT wiki article:

Using a Dynamic Host Page for Authentication and Initialization

You might have to switch to using JavaScript to hold the initialization data in the page using this approach.

share|improve this answer
add comment

I don't know GWT, but I think that an asynchronous request is OK. Client looks for its prefs. If they are missing, it request them. As simple as that.

share|improve this answer
add comment

Your Answer


