[abportal] Annotation of /src/main/java/eu/smartlm/abs/portal/security/login/admin/RemoveUserController.java
Annotation of /src/main/java/eu/smartlm/abs/portal/security/login/admin/RemoveUserController.java
Parent Directory
| Revision Log
Revision 1 -
(view)
(download)
1 : |
dgarcia |
1 |
package eu.smartlm.abs.portal.security.login.admin;
|
2 : |
|
|
|
3 : |
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
4 : |
|
|
import org.springframework.beans.factory.annotation.Qualifier;
|
5 : |
|
|
import org.springframework.stereotype.Controller;
|
6 : |
|
|
import org.springframework.web.bind.annotation.RequestMapping;
|
7 : |
|
|
import org.springframework.web.bind.annotation.RequestParam;
|
8 : |
|
|
import org.springframework.web.portlet.bind.annotation.ActionMapping;
|
9 : |
|
|
|
10 : |
|
|
import eu.smartlm.abs.portal.security.login.service.LoginService;
|
11 : |
|
|
|
12 : |
|
|
/**
|
13 : |
|
|
* Removes a user from the database
|
14 : |
|
|
* @author David García Pérez - CESGA
|
15 : |
|
|
*
|
16 : |
|
|
*/
|
17 : |
|
|
@Controller
|
18 : |
|
|
@RequestMapping("VIEW")
|
19 : |
|
|
public class RemoveUserController {
|
20 : |
|
|
@Autowired
|
21 : |
|
|
@Qualifier("myLoginService")
|
22 : |
|
|
private LoginService loginService;
|
23 : |
|
|
|
24 : |
|
|
public void setLoginService(LoginService loginService) {
|
25 : |
|
|
this.loginService = loginService;
|
26 : |
|
|
}
|
27 : |
|
|
|
28 : |
|
|
/**
|
29 : |
|
|
* Maps the action of the jsp to the action of the controller
|
30 : |
|
|
* @param username
|
31 : |
|
|
*/
|
32 : |
|
|
@ActionMapping(params="myaction=removeUser")
|
33 : |
|
|
public void removeBook(@RequestParam String username) {
|
34 : |
|
|
loginService.removeUser(username);
|
35 : |
|
|
}
|
36 : |
|
|
}
|
|