2014 5 28
今晚的主要任务是对项目中已经做出来的注册和登陆界面添加后台。
这是登陆
还有注册
我们看LoginUser的Controller
@RequestMapping
(
"/user"
)
@Controller
public
class
LoginUserController
extends
BaseController {
@Resource
private
LoginUserService
userService
;
@RequestMapping
(value =
"regist"
, method = RequestMethod.
GET
)
public
ModelAndView regist(ModelAndView modelAndView) {
return
JspLocation(modelAndView,
"regist"
);
这里的是首先mapping映射一下,然后声明是控制器。注入Service,声明get方法。
@RequestMapping
(value =
"regist"
, method = RequestMethod.
POST
)
public
ModelAndView regist(ModelAndView modelAndView,
@Valid
@ModelAttribute
LoginUser user, BindingResult bindResult) {