zoukankan      html  css  js  c++  java
  • spring mvc requestmapping 配置多个

    参考

    import org.springframework.stereotype.Controller;
    import org.springframework.web.bind.annotation.RequestMapping;
    import org.springframework.web.bind.annotation.RequestMethod;
    import org.springframework.web.bind.annotation.ResponseBody;
    
    import javax.servlet.http.HttpServletRequest;
    
    @Controller
    //@RequestMapping(value = "/test_web/prefix")
    @RequestMapping(value = {
            "/test_web/prefix",
            "/test-web/prefix"
    })
    public class DeveloperControllerTest {
        @RequestMapping(value = "/testcfg", method = RequestMethod.POST)
        @ResponseBody
        public String setCfg(String command, HttpServletRequest request){
            System.out.println("command:" + command);
            System.out.println("request:" + request);
            return "hello test";
        }
    
        @RequestMapping(value = "/mvccfg2", method = RequestMethod.POST)
        @ResponseBody
        public String setCfg2(){
            return "123";
        }
    
    //    @RequestMapping(value = "/mvccfg3", method = RequestMethod.POST)
    //    public String setCfg3(){
    //        return "123";
    //    }
    }
  • 相关阅读:
    java变量类型
    java基本数据类型
    java对象和类
    java认识
    vue-随笔-transition
    vue-随笔-class-style
    vue-随笔-form-elements
    Constructing Roads*
    hdu3371 Connect the Cities
    hdu1879浙大计算机研究生复试上机(2008)继续畅通工程
  • 原文地址:https://www.cnblogs.com/kaituorensheng/p/8975390.html
Copyright © 2011-2022 走看看