1)通过模块根路径 + 功能子路径 = 访问模块下子功能的路径
@Controller @RequestMapping(value="/user") public class UserAction{ @RequestMapping(value="/add") public String add(Model model) throws Exception{ System.out.println("HelloAction::add()"); model.addAttribute("message","增加用户"); return "/success.jsp"; } @RequestMapping(value="/find") public String find(Model model) throws Exception{ System.out.println("HelloAction::find()"); model.addAttribute("message","查询用户"); return "/success.jsp"; } }
增加用户:http://127.0.0.1:8080/myspringmvc/user/add.action
查询用户:http://127.0.0.1:8080/myspringmvc/user/find.action
原文地址:https://www.cnblogs.com/loaderman/p/10063287.html
时间: 2024-10-23 06:07:39