helloworld类中代码: package com.springmvc; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMethod; @Controller public class helloworld { @RequestMapping(name = "/helloworld", method = RequestMethod.GET) public String helloworld(){ System.out.println("hello world"); return "success"; } }
2、springmvc.xml中代码:
<?xml version="1.0" encoding="UTF-8"?> <beans