Spring 项目期望位于根目录,当它不在根目录时会感到害怕
我有一个 Spring 项目,当它位于 Web 根目录时,它可以完美地工作 - 即 http://myserver/index.html 但当它不是时它会严重破坏 - 即 http://myserver/spring-project/index.html
有没有办法将 spring 配置为位于子目录中?浏览文档完全没有帮助。
I have a spring project that works beautifully when it's located at the web root - i.e. http://myserver/index.html but it breaks terribly when it's not - i.e. http://myserver/spring-project/index.html
Is there a way to configure spring to live in a subdirectory? Going through docs has been entirely unhelpful.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
Spring 不要求它位于根目录中即可工作。
如果它不起作用,那是因为您配置、打包和部署不正确。
我建议将 AppFuse 放在一边,并尝试几次手动成功地配置、打包和部署应用程序,直到您知道如何做到这一点。一旦你掌握了它,就可以引入 AppFuse 来减轻你的负担。
Spring does not require that it be in the root directory to work.
If it's not working, it's because you configured, packaged, and deployed it incorrectly.
I would recommend putting AppFuse aside and figuring out how to configure, package, and deploy an app successfully by hand a few times until you know how to do it cold. Once you have that in hand, then bring AppFuse in to lighten your load.