You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
40 lines
1.0 KiB
40 lines
1.0 KiB
package org.ros.chatto.controller;
|
|
import org.ros.chatto.repository.UserRepositoryCustom;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.stereotype.Controller;
|
|
import org.springframework.web.bind.annotation.RequestMapping;
|
|
import org.springframework.web.servlet.ModelAndView;
|
|
|
|
|
|
/*
|
|
@Controller
|
|
@RequestMapping(value = "/test")
|
|
public class TestController {
|
|
|
|
@GetMapping
|
|
public ModelAndView getTestData() {
|
|
ModelAndView mv = new ModelAndView();
|
|
mv.setViewName("welcome");
|
|
mv.getModel().put("data", "Welcome home man");
|
|
|
|
return mv;
|
|
}
|
|
}*/
|
|
|
|
@Controller
|
|
public class Home {
|
|
@Autowired
|
|
UserRepositoryCustom userRepositoryCustom;
|
|
@RequestMapping("/")
|
|
public ModelAndView showPage() {
|
|
ModelAndView mv = new ModelAndView("home");
|
|
mv.addObject("message", "Welcome!");
|
|
mv.addObject("userNames", userRepositoryCustom.getAllUserNames("hmm"));
|
|
return mv;
|
|
}
|
|
// public String showHome(Model model)
|
|
// {
|
|
// model.addAttribute("message", "Welcome");
|
|
// return "home";
|
|
// }
|
|
}
|