2011-04-01 25 views
1

我使用UserService重定向到登錄頁面:UserService.createLoginURL導致「您請求的頁面無效」。錯誤

String loginURL = userService.createLoginURL(request.getRequestURI()); 
throw new ModelAndViewDefiningException(new ModelAndView(new RedirectView(loginURL, false))); 

這導致像網址:

https://www.google.com/accounts/ServiceLogin?service=ah&passive=true&continue=https://appengine.google.com/_ah/conflogin%253Fcontinue%253Dhttp://www.example.com/logingoogle.htm&ltmpl=gm&ahname=example&sig=5291e6bad7249c73c4968655133c87c5

(例如=我的域名)

當有人Google顯示錯誤頁面:

The page you requested is invalid.

任何想法我做錯了什麼? 這太令人討厭了,我試圖找到解決方案 - 沒有任何運氣。

這與GAE JDK 1.4.3(JAVA)

完全相同的代碼在1.3.2版本的工作,一段時間後,我決定用GAE再次發揮,升級庫發生......現在我有登錄問題。

回答

1

我今天遇到了這個問題,GAE 1.6.3。

登錄不與URL工作,你上面給:

https://www.google.com/accounts/ServiceLogin?service=ah&passive=true&continue=https://appengine.google.com/_ah/conflogin%253Fcontinue%253Dhttp://www.example.com/logingoogle.htm&ltmpl=gm&ahname=example&sig=5291e6bad7249c73c4968655133c87c5

但是,如果你更換工作 「?https://www.google.com/accounts/ServiceLogin」與 「https://accounts.google.com/ServiceLogin?」 這樣的:

https://accounts.google.com/ServiceLogin?service=ah&passive=true&continue=https://appengine.google.com/_ah/conflogin%253Fcontinue%253Dhttp://www.example.com/logingoogle.htm&ltmpl=gm&ahname=example&sig=5291e6bad7249c73c4968655133c87c5

不幸的是,無法修改該URL,因爲它是由UserService生成的。 但我可以讓我的應用程序以這種方式生成第二個網址:

我的應用程序的默認頁面最初通過「jsp:forward」向控制器發送請求,該控制器檢查用戶是否已登錄。已經改變了我的應用程序,以便控制器在第一時間處理請求(沒有前一個轉發)。這解決了我的問題。但我無法解釋這種不正當行爲背後的原因。

+0

謝謝,前不久我放棄了GAE。需要花費更多時間來解決它的侷限性,而不是實際的應用程序...... – Konrad 2012-03-05 21:18:07