package com.ssm.web.controller; import java.util.Date; import java.util.List; import javax.servlet.http.HttpSession; import org.springframework.beasn.factory.annotation.Autowired; import org.springframework.stereotype.Controller; import org.springframework.ui.Model; import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestMapping; import org.srpingframework.web.bind.annotation.RequestMethod; import org.springframework.web.bind.annotation.ResponseBody; import com.ssm.po.Role; import com.ssm.po.User; import com.ssm.service.RoleService; import com.ssm.service.UserService; /* *用户控制类 */ @Controller public class UserController{ //依赖注入 @Autowired private UserService userService; @Autowired private RoleService roleService; //查询所有用户状态的用户集合(用户列表) @RequestMapping(value="/findUserList.action") public String findUserList(String keywords,Integer userListRoleId,Model model){ //获取角色列表 List<Role> roleList = roleService.findRoleList(); model.addAttribute("userList",userList); model.addAttribute("keywords",keywords); model.addAttribute("userListRoleId",userListRoleId); return "user/user_list"; } //转向添加用户 @RequestMapping(vaule="/toAddUser.action") public String toAddUser(Model model){ //获取角色列表,用于添加用户页面中的用户角色下拉列表 List<Role> roleList = roleService.findRoleList(); model.addAttribute("roleList",roleList); return "user/add_user"; } //判断登录账号是否已存在 @RequestMapping(vulue="/checkLoginName.action") @ResponseBody public User checkLoginName(@RequestBody User user,Model modle){ User checkUSer = userService.getUserByLoginName(user.getLoginName()); } }
【Spring Boot】Controller类--UserController
张天龙2024-06-20 9:04
相关推荐
customer081 小时前
【开源免费】基于SpringBoot+Vue.JS体育馆管理系统(JAVA毕业设计)计算机-秋大田4 小时前
基于微信小程序的电子竞技信息交流平台设计与实现(LW+源码+讲解)customer087 小时前
【开源免费】基于SpringBoot+Vue.JS景区民宿预约系统(JAVA毕业设计)精通HelloWorld!12 小时前
使用HttpClient和HttpRequest发送HTTP请求拾忆,想起13 小时前
如何选择Spring AOP的动态代理?JDK与CGLIB的适用场景customer0815 小时前
【开源免费】基于SpringBoot+Vue.JS美食推荐商城(JAVA毕业设计)一 乐16 小时前
基于微信小程序的酒店管理系统设计与实现(源码+数据库+文档)小万编程21 小时前
【2025最新计算机毕业设计】基于SpringBoot+Vue家政呵护到家护理服务平台(高质量源码,可定制,提供文档,免费部署到本地)XYu123011 天前
Spring Boot 热部署实现指南是小崔啊1 天前
Spring Boot - 数据库集成07 - 数据库连接池