Home > Back-end >  Spring after the boot into war file, ajax access controller 404. Help!
Spring after the boot into war file, ajax access controller 404. Help!

Time:09-30

Tested no problem in the idea, into war after the bag bosses, I use an ajax request to the controller, but can't access, 404, but on the url manually add the project name, plus the path of the controller is accessible, has taken the spring boot built-in tomcat is set to not packaged, is placed in the external tomcat, the request without the project name, but combined with the project name, request to automatically add a project name,

CodePudding user response:

Do you want to put into the war package name changed to ROOT (in pom. Xml There configuration, specific baidu), tomcat can don't need to add the project name prefix access

CodePudding user response:

You can be in spirng configuration file with the context path configuration, also can be the name of the war file high ROOT, because tomcat is the default access to the ROOT project, so you don't want to add the project name, will have to change their project to ROOT

CodePudding user response:

But more war packages, cannot have two ROOT ah
  • Related