使用 @RequestMapping 注解,需要导入的包:spring-webmvc

在Controller 层使用 @RequestMapping注解,需要导入的包:spring-webmvc。

在类中需要添加:import org.springframework.web.bind.annotation.RequestMapping;

本文参考了:http://www.cnblogs.com/JavaTechLover/archive/2012/09/03/spring-controller2.html 

里面有详细的讲解!

原文地址:https://www.cnblogs.com/JAVA-STUDYER/p/7125407.html