问题
I am working in GWT project. As per the requirement, i have to provide auto-refresh to one of my screen.
My senior told me to use <meta http-equiv="refresh" content="300"> in that screen page.
But as GWT code is written in java only, so i wonder how can I use it in java file.
Can somebody help?
回答1:
Depending on how you are managing history and if you are not using places. You can use the location reload event inside a timer.
If you are using places, you can use your place controller to re navigate to the same place every 30 seconds
Timer t = new Timer() {
public void run() {
Window.Location.reload();
}
};
t.scheduleRepeating(30000);
来源:https://stackoverflow.com/questions/12195207/gwt-auto-refresh