大佬能不能解释一下为啥注解在类上的requestmapping会加到资源路径上,在jsp页面的@RequestMapping("/seckill")
public class SeckillController {
Logger logger= LoggerFactory.getLogger(this.getClass());
@Autowired
private SeckillService seckillService; //获取商品列表
@RequestMapping(value="/list",method= RequestMethod.GET)
public String list(Model model){
List<Seckill> list=seckillService.getSeckillList(0,20);
model.addAttribute("list",list);
return "/list";
}
错误:
HTTP Status 404 – Not Found
Type Status ReportMessage /seckill/WEB-INF/jsp/list.jspDescription The origin server did not find a current representation for the target resource or is not willing to disclose that one exists.
public class SeckillController {
Logger logger= LoggerFactory.getLogger(this.getClass());
@Autowired
private SeckillService seckillService; //获取商品列表
@RequestMapping(value="/list",method= RequestMethod.GET)
public String list(Model model){
List<Seckill> list=seckillService.getSeckillList(0,20);
model.addAttribute("list",list);
return "/list";
}
错误:
HTTP Status 404 – Not Found
Type Status ReportMessage /seckill/WEB-INF/jsp/list.jspDescription The origin server did not find a current representation for the target resource or is not willing to disclose that one exists.
配置webinf前面加个/
希望有帮助
/seckill/list