2010-09-21 94 views
0

在我的應用程序中使用瀏覽器上的刷新按鈕gwt2.1點擊發達導致主頁和令牌仍停留在URL,因爲這是我的鏈接將不會工作。 例如假設我的鏈接是鏈接1,鏈接2,LINK3和#鏈接1,#鏈接2,#LINK3是各自的令牌。現在點擊鏈接1將有以下網址http://localhost:8080/myproject/home.htm#link1GWT瀏覽器刷新問題

 Clicking on link2 will have following url http;//localhost:8080/myproject/home.htm#link2 and so on for other links. 

     Now the problem is : Suppose i click on link1 so my url will be http://localhost:8080/myproject/home.htm#link1 now when i click browser's refresh button it leads me to home page and my url will be still http://localhost:8080/myproject/home.htm#link1 i.e. the token still remains in the url because of which this link doesn't when clicked after refresh. 

回答

1

你在你的onModuleLoad firering當前歷史狀態你的EntryClass函數?

只需添加

History.fireCurrentHistoryState(); 

這樣做。

+0

雅我在onModuleLoad函數射擊它..但我要搜索的解決方案是:點擊刷新讓它回到主頁,但該網址應該是http:// localhost:8080/myproject/home.htm即令牌在刷新後應該消失。 – java 2010-09-22 05:48:44

+0

對不起,我誤解了這一點。你有沒有嘗試過History.newItem(「」);在你的onModuleLoad()? – 2010-09-22 07:57:19