如何解决原始服务器找不到目标资源的当前表示,或者不愿意透露该资源的存在在部署到tomcat?
如果你正在开发Spring Boot应用程序,请在主文件中添加“ SpringBootServletinitializer”,如以下代码所示。因为如果没有SpringBootServletinitializer,Tomcat会将其视为普通应用程序,则不会将其视为Spring引导应用程序。
@SpringBootApplication
public class DemoApplication extends SpringBootServletinitializer{
@Override
protected SpringApplicationBuilder configure(SpringApplicationBuilder application) {
return application.sources(DemoApplication .class);
}
public static void main(String[] args) {
SpringApplication.run(DemoApplication .class, args);
}
}
我为此问题挣扎过很多次。
我当前使用的解决方案是在webapp(或保存了jsp之类的视图的文件夹)处于部署程序集下。
这样做Right click on the project > Build Path > Configure Build path > Deployment Assembly > Add(right hand side) > Folder > (add your jsp文件夹。在默认情况下为src/ma