Springbootがtomcatをパブリッシュした後の静的ファイルパスの問題


1.warとしてtomcatを発行するにはリソースパスの問題がありますか?アプリケーションを変更します.propertiesファイル;追加:(sonicApplication、対応warパッケージ名)
server.servlet.context-path=/sonicApplication

2.Thymeleafテンプレートを使用する場合:htmlを変更し、ファイルを参照する方法、例えば
 





    var ctx = [[@{/}]];


 ajax  ctx   war 
$http({
    method : "post",
    url : ctx + "appJson/getSearch",
    params : {"search": $scope.searchTest}
}).success(function (data) {
  
})

@ResponseBody
@RequestMapping("/getSearch")
public RestResultModule getSearch(
        @RequestParam(name = "search",required = false,defaultValue = "")String search){
    
  Tomcat     springboot  ,   application.yml    ,      
spring:
  # 多个springboot项目部署,需加
  jmx:
    enabled: false
springboot     tomcat : https://blog.csdn.net/weixin_38351566/article/details/83864259
    .