package com.ryw.mavendemo.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.ryw.mavendemo.model.User;
import com.ryw.mavendemo.service.IUserService;

@Controller("userController")
@RequestMapping("/user")
public class UserController {
	@Resource
	private IUserService userService;

	@RequestMapping("/showuser")
	public String show(HttpServletRequest request, Model model) {

		User user = this.userService.getUserById(1);
		model.addAttribute("user", user);
		return "show";

	}
}
