码迷,mamicode.com
首页 > 移动开发 > 详细

spring mvc requestmapping 配置多个

时间:2018-05-01 01:04:14      阅读:189      评论:0      收藏:0      [点我收藏+]

标签:vax   body   frame   port   ref   type   imp   iba   let   

参考

package com.alibaba.iucheck.gdstoredis.web.controllers;

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";
//    }
}

 

spring mvc requestmapping 配置多个

标签:vax   body   frame   port   ref   type   imp   iba   let   

原文地址:https://www.cnblogs.com/kaituorensheng/p/8975390.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!