首页>代码>spring+springmvc+mybatis案例实现用户登录注册功能>/login_register/src/com/ms/ssm/controller/UsersController.java
package com.ms.ssm.controller; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.RequestMapping; import com.ms.ssm.pojo.Users; import com.ms.ssm.service.UsersService; @Controller public class UsersController { @Autowired UsersService usersService; @RequestMapping("/login") public String loginUsers(Users users,HttpServletRequest req, HttpServletResponse resp){ String code = req.getParameter("code"); String codeSession = req.getSession().getAttribute("code").toString(); if(codeSession.equals(code)){ Users user=usersService.selectUsers(users); if(user!=null){ return "success"; } }else{ return "fail"; } return "fail"; } @RequestMapping("/insert") public String insertUsers(Users users){ usersService.insertUsers(users); return "success"; } }
最近下载更多
哇哇敲代码 LV1
3月20日
微信网友_6802079662936064 LV3
2023年12月31日
少时诵诗书dddddd LV2
2023年12月22日
CCCCWWWW LV4
2023年12月10日
qiufengSY LV1
2023年9月7日
shihuawei6 LV1
2023年7月2日
yangbulx LV3
2023年5月24日
zhubowei LV2
2023年5月11日
GoodGame1234 LV4
2023年5月6日
女王不该在山炮村养花 LV8
2023年4月13日
最近浏览更多
微信网友_6512020493586432 LV2
4月12日
lingtiejing LV15
4月10日
rr114514
3月27日
暂无贡献等级
哇哇敲代码 LV1
3月20日
佛爷戈用飘柔
3月19日
暂无贡献等级
winderrr LV1
1月9日
微信网友_6802079662936064 LV3
2023年12月31日
少时诵诗书dddddd LV2
2023年12月22日
rootroot156
2023年12月16日
暂无贡献等级
yexinggg
2023年12月15日
暂无贡献等级