esolve
V2EX  ›  问与答

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

  •  
  •   esolve · Apr 28, 2017 · 6575 views
    This topic created in 3475 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
    zhuyao
    Apr 28, 2017
    1
    猜测是 client:server 你可以写成 127.0.0.1:192.x.x.x
    esolve
    esolve
    OP
    Apr 28, 2017
    2
    @zhuyao 我意思是,这个冒号啥意思?
    luulsj
    luulsj
    Apr 28, 2017
    3
    在下面的网址搜索,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   ·   Privacy   ·   Solana   ·   5108 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 31ms · UTC 07:40 · PVG 15:40 · LAX 23:40 · JFK 02:40
    ♥ Do have faith in what you're doing.