Created
November 27, 2012 06:32
-
-
Save grapswiz/4152729 to your computer and use it in GitHub Desktop.
ログインページに飛んでほしい
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| $(function(){ | |
| $("#login_button").on("click", function(){ | |
| var loginReq = $.ajax({ | |
| url: "/login", | |
| type: "GET" | |
| }); | |
| }); | |
| }); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <!DOCTYPE HTML> | |
| <html lang="en-US"> | |
| <head> | |
| <meta charset="UTF-8"> | |
| <title>Index</title> | |
| <script type="text/javascript" src="jquery-1.8.2.min.js"></script> | |
| <script type="text/javascript" src="app.js"></script> | |
| </head> | |
| <body> | |
| <input type="button" value="ログイン" id="login_button"> | |
| </body> | |
| </html> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package info.graps.controller; | |
| import org.slim3.controller.Controller; | |
| import org.slim3.controller.Navigation; | |
| import com.google.appengine.api.users.UserService; | |
| import com.google.appengine.api.users.UserServiceFactory; | |
| public class LoginController extends Controller { | |
| @Override | |
| public Navigation run() throws Exception { | |
| UserService userService = UserServiceFactory.getUserService(); | |
| response.sendRedirect(userService.createLoginURL("/")); | |
| return null; | |
| } | |
| } |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
ajaxがredirectされてもブラウザ上は変化なし