package com.yinlu.cms.action;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.servlet.ModelAndView;
@Controller
@RequestMapping("/login")
public class HelloController {
@RequestMapping("/hello/{name}")
public String HelloController(@PathVariable("name") String name){
System.out.println(name);
return "login";
}
@RequestMapping(value="/post",method=RequestMethod.POST)
public String postStart(){
return "post";
}
@RequestMapping("/list/{name}")
public ModelAndView userlist(@PathVariable("name") String name){
ModelAndView mv=new ModelAndView();
mv.setViewName("list");
mv.addObject("name", "yinlu");
System.out.println(name);
return mv;
}
}
09-08
09-08