package com.zm.controller; import org.springframework.beans.factory.annotation.Autowired;import org.springframework.jdbc.object.UpdatableSqlQuery; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.servlet.ModelAndView; import com.zm.pojo.Admin; import com.zm.pojo.User; import com.zm.service.UserService; //告诉springmvc这是一个controller @Controller //设置映射路径 @RequestMapping("") public class UserController { //装配userService @Autowired UserService userService; @RequestMapping("regist") public ModelAndView regist(User user) { ModelAndView mav = new ModelAndView("regist"); if (user.getUser_name()!=null&&!"".equals(user.getUser_name())) { userService.add(user); return new ModelAndView("redirect:/login"); } else { return mav; } } @RequestMapping("login") public ModelAndView login(User user) { ModelAndView mav = new ModelAndView("login"); User u = userService.select(user); if (u!=null) { return new ModelAndView("redirect:/listAdmin"); } else { return mav; } } }
最近下载更多
768881787 LV7
2023年12月25日
李亮 LV19
2023年8月29日
zcx12345678 LV6
2023年5月26日
dsdadg LV1
2023年4月29日
Soratosiro LV6
2022年12月4日
天士大夫 LV2
2022年11月12日
2635474 LV1
2022年6月17日
张真狗 LV9
2022年6月14日
AAAAAF LV5
2022年6月4日
兰文斌 LV6
2022年5月4日
最近浏览更多
adscazsc
3月12日
暂无贡献等级
songsmm LV1
3月11日
minjing123 LV8
1月4日
沈从文 LV2
1月1日
768881787 LV7
2023年12月25日
wwwww816 LV3
2023年12月19日
2775645521 LV5
2023年12月13日
flygrass LV12
2023年12月7日
微信网友_6766536528596992 LV1
2023年12月6日
mds123456 LV2
2023年11月3日