This commit is contained in:
Luke Taylor 2010-07-23 01:57:45 +01:00
parent 2afccfc633
commit e659e15f90
3 changed files with 8 additions and 10 deletions

View File

@ -1,7 +1,5 @@
package samples.gae.users; package samples.gae.users;
import com.google.appengine.api.datastore.EntityNotFoundException;
/** /**
* *
* Service used to maintain a list of users who are registered with the application. * Service used to maintain a list of users who are registered with the application.

View File

@ -38,7 +38,7 @@ public class GaeAppController {
String logoutUrl = UserServiceFactory.getUserService().createLogoutURL("/loggedout.htm"); String logoutUrl = UserServiceFactory.getUserService().createLogoutURL("/loggedout.htm");
response.sendRedirect(logoutUrl); response.sendRedirect(logoutUrl);
} }
@RequestMapping(value = "/loggedout.htm", method= RequestMethod.GET) @RequestMapping(value = "/loggedout.htm", method= RequestMethod.GET)

View File

@ -34,11 +34,11 @@ public class RegistrationController {
return new RegistrationForm(); return new RegistrationForm();
} }
@RequestMapping(method = RequestMethod.POST) @RequestMapping(method = RequestMethod.POST)
public String register(@Valid RegistrationForm form, BindingResult result) { public String register(@Valid RegistrationForm form, BindingResult result) {
if (result.hasErrors()) { if (result.hasErrors()) {
return null; return null;
} }
Authentication authentication = SecurityContextHolder.getContext().getAuthentication(); Authentication authentication = SecurityContextHolder.getContext().getAuthentication();
GaeUser currentUser = (GaeUser)authentication.getPrincipal(); GaeUser currentUser = (GaeUser)authentication.getPrincipal();
@ -56,6 +56,6 @@ public class RegistrationController {
// Update the context with the full authentication // Update the context with the full authentication
SecurityContextHolder.getContext().setAuthentication(new GaeUserAuthentication(user, authentication.getDetails())); SecurityContextHolder.getContext().setAuthentication(new GaeUserAuthentication(user, authentication.getDetails()));
return "redirect:/home.htm"; return "redirect:/home.htm";
} }
} }