Home  >  Q&A  >  body text

java - springboot deployed to tomcat url request path problem

1. Springboot local development, context-path: /hbgj/ homepage access /hbgj/v1/index, another post request is ajax access url is /v1/dayJob, all are normal
2. Pack the war package into tomcat. The package name is hbgj.war. Visit hbgj/v1/index on the homepage. The request for the other two posts is still /v1/dayJob without modification, and 404 is displayed. This request is written in a separate js file
3. There is another form submission that is also normal th:action="@{/v1/fuzzy}" method="GET"

Could you please tell me how you usually deal with this situation and ensure that the development method is consistent with the formal environment

漂亮男人漂亮男人2713 days ago469

reply all(1)I'll reply

  • PHP中文网

    PHP中文网2017-05-17 10:06:07

    youjs中的请求没有带contextpath

    reply
    0
  • Cancelreply