1 package compbio.controllers;
3 import org.springframework.stereotype.Controller;
4 import org.springframework.ui.ModelMap;
5 import org.springframework.web.bind.annotation.RequestMapping;
6 import org.springframework.web.bind.annotation.RequestMethod;
9 public class MainController extends BasicController {
11 @RequestMapping(value = "/index", method = RequestMethod.GET)
12 public String printPublicHome(ModelMap model) {
13 model.addAttribute("username", getPrincipalName());
14 if (isUserRole()) return "home";
18 @RequestMapping(value = "/login", method = RequestMethod.GET)
19 public String login(ModelMap model) {
23 @RequestMapping(value = "/loginfailed", method = RequestMethod.GET)
24 public String loginerror(ModelMap model) {
25 model.addAttribute("error", "Wrong user name or password");
29 @RequestMapping(value = "/logout", method = RequestMethod.GET)
30 public String logout(ModelMap model) {
34 @RequestMapping(value = "/denied", method = RequestMethod.GET)
35 public String denied(ModelMap model) {
36 model.put("username", getPrincipalName());
37 return "support/Denied";
40 @RequestMapping(value = "/home", method = RequestMethod.GET)
41 public String printHome(ModelMap model ) {
42 model.addAttribute("username", getPrincipalName());