在线观看不卡亚洲电影_亚洲妓女99综合网_91青青青亚洲娱乐在线观看_日韩无码高清综合久久

鍍金池/ 問答/Java/ spring boot 正則路由怎么實現(xiàn)

spring boot 正則路由怎么實現(xiàn)

想實現(xiàn)的效果:

/static/** 以外的所有訪問都由一個控制器實現(xiàn)。

clipboard.png
如圖:

希望 HomeController@index 方法能處理所有請求; 但 /static/** 路徑的除外。
以上代碼還不能實現(xiàn)該功能請問哪里有問題,該如何調(diào)整?
回答
編輯回答
尕筱澄
@GetMapping("/{path:^(?!static).*}/{path:[^\\.]*}")
2018年5月11日 19:28