zoukankan      html  css  js  c++  java
  • @RestController的方法中 路径参数带.(点号)配置


    如下面这种
    //http://localhost:8080/api/v1/user/info/email/test@163.com
     @RequestMapping(value = "/info/email/{email}",method = RequestMethod.GET)
        public User getInfoByEmail(@PathVariable String email){
            User user = userRepository.findByEmail(email);
            return user;
        }
    
    
    


    //继承adapter 设置属性即可。
    import
    org.springframework.context.annotation.Configuration; import org.springframework.web.servlet.config.annotation.PathMatchConfigurer; import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter; /** * Created by Administrator on 2017/7/10 0010. */ @Configuration public class WebConfig extends WebMvcConfigurerAdapter { @Override public void configurePathMatch(PathMatchConfigurer configurer) { configurer.setUseSuffixPatternMatch(false); } }

     

  • 相关阅读:
    数据类型
    python安装
    计算机基础
    Ajax--1
    ASP.net+MVC--2
    More lumber is required
    History Grading
    strcmp() Anyone?
    How Many Points of Intersection?
    Remember the Word
  • 原文地址:https://www.cnblogs.com/zyzcj/p/7232365.html
Copyright © 2011-2022 走看看