1
|
package vldc.aswi.web.controller;
|
2
|
|
3
|
import org.springframework.stereotype.Controller;
|
4
|
import org.springframework.web.bind.annotation.GetMapping;
|
5
|
import org.springframework.web.bind.annotation.PostMapping;
|
6
|
import org.springframework.web.servlet.ModelAndView;
|
7
|
|
8
|
@Controller
|
9
|
public class LoginController extends BasicController {
|
10
|
|
11
|
/**
|
12
|
* Get mapping method for login page.
|
13
|
* @return Model and view for login page.
|
14
|
*/
|
15
|
@GetMapping("/login")
|
16
|
public ModelAndView login() {
|
17
|
ModelAndView modelAndView = new ModelAndView("login");
|
18
|
|
19
|
return modelAndView;
|
20
|
}
|
21
|
|
22
|
/**
|
23
|
* Logout.
|
24
|
* @return the string
|
25
|
*/
|
26
|
@PostMapping(value = "/logout")
|
27
|
public String logout()
|
28
|
{
|
29
|
return "redirect:/login";
|
30
|
}
|
31
|
|
32
|
}
|