首页>代码>Myeclipse搭建Spring+Spring Mvc+Mybatis+Maven+数据库Mysql项目demo实现SSM的Hello world>/ssm/src/main/java/com/java/controller/UserController.java
package com.java.controller;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import com.java.model.Userm;
import com.java.service.UserService;
@Controller
@RequestMapping("/user")
public class UserController {
@Resource
private UserService userService;
@RequestMapping("/showUser")
public String toIndex(HttpServletRequest request,Model model){
System.out.println("½øÈë·½·¨");
int userId = Integer.parseInt(request.getParameter("id"));
Userm user = this.userService.byidgetname(userId);
System.out.println(user.getUsername());
model.addAttribute("user", user);
return "Showssm";
}
}
最近下载更多
最近浏览更多
152873 LV2
2024年12月27日
zouzou123 LV3
2024年10月18日
李彦宏
2024年6月21日
暂无贡献等级
minjing123 LV8
2024年1月4日
yolo_light LV1
2023年12月20日
hanser
2023年6月25日
暂无贡献等级
yeali178 LV1
2023年6月10日
李亮 LV19
2023年3月6日
景与行
2023年3月2日
暂无贡献等级
qwer123978ca LV1
2022年12月20日

