@Controller @RequestMapping("/Person") public class PersonManagerService { private Logger log = LoggerFactory.getLogger(PersonManagerService.class); @Resource private PersonManager myPersonManager; public PersonManager getMyPersonManager() { return myPersonManager; } public void setMyPersonManager(PersonManager personManager) { this.myPersonManager = personManager; } @RequestMapping(value="/searchPagePerson.do",method = RequestMethod.POST) public ModelAndView searchPagePerson(HttpServletRequest request, HttpServletResponse response){ *** }
对于采用上述方式访问运行过程中指定的路径找不到的问题,请查看spring配置的问题:
<bean class="org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter"/> <context:component-scan base-package="com.sinosoft.ie.aids.lab.samples.service"/>
这个必须要配的。