}
@RequestMapping("/{userId}/delete")
public String deleteUser(@PathVariable("userId") int userId,
HttpServletRequest request, SessionStatus status) {
User user = userService.loadUser(userId);
if (user != null) {
String userName = user.getName();
if (userService.canDelete(user)) {
status.setComplete();
String currentUser = SecurityContextHolder.getContext().getAuthentication().getName();
boolean isThisUser = currentUser != null && currentUser.equals(user.getName());
userService.delete(user);
if (isThisUser) {
return "redirect:/j_spring_security_logout";