esolve
V2EX  ›  问与答

Springmvc 里 @RequestMapping 的 path 里花括号里有冒号的作用是什么?

  •  
  •   esolve · Apr 28, 2017 · 6251 views
    This topic created in 3339 days ago, the information mentioned may be changed or developed.

    如下

    @requestMapping("/consumers/{client:server}/goods") public class ConsumerGoods{ .... }

    这个{client:server}是啥意思? 谢谢!

    4 replies    2017-04-28 17:28:52 +08:00
    zhuyao
        1
    zhuyao  
       Apr 28, 2017
    猜测是 client:server 你可以写成 127.0.0.1:192.x.x.x
    esolve
        2
    esolve  
    OP
       Apr 28, 2017
    @zhuyao 我意思是,这个冒号啥意思?
    luulsj
        3
    luulsj  
       Apr 28, 2017
    在下面的网址搜索,URI Template Patterns with Regular Expressions
    https://docs.spring.io/spring/docs/current/spring-framework-reference/html/mvc.html
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   958 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 33ms · UTC 18:49 · PVG 02:49 · LAX 11:49 · JFK 14:49
    ♥ Do have faith in what you're doing.