1、对HelloSchool类中添加
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
@Controller
@ResponseBody
public class HelloSchool {
@RequestMapping("/hello")
public String hello(String name,int age){
return “hello:”+name+",年龄为:" +age;
}
}

2、在Main下运行

3、在浏览器中输入
localhost:8080/hello?age=18&name=“xiaokui”