JSF 应用程序为子上下文提供 404

发布于 2024-09-19 11:03:35 字数 369 浏览 1 评论 0原文

我的 JSF 应用程序在本地 tomcat 中运行,其 URL 类似于 http://localhost:8080/MyApp/admin ,但不在托管服务器上,URL 为 http://www.myapp.com/admin 我需要对 'context.xml'/ put BocBase & 执行某些操作吗?应用程序库。我在谷歌上搜索到了这些东西,但不明白我到底要做什么。任何人都可以帮助我完成必须做的确切事情才能使其正常工作吗?

My JSF application works in my local tomcat for URL like http://localhost:8080/MyApp/admin, but not on the hosting server, the URL there is http://www.myapp.com/admin
Do I need to do something with 'context.xml'/ put BocBase & AppBase. I got these things googling, but could not understand what exactly I have to do. Can anyone help me with the exact thing thats has to be done to get this working?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

变身佩奇 2024-09-26 11:03:35

Tomcat 的配置参考 - 上下文容器对此进行了描述

文档库

此 Web 应用程序的文档库(也称为上下文根)目录,或 Web 应用程序存档文件的路径名(如果正在使用此 Web 应用程序)直接从 WAR 文件执行)。您可以为此目录或 WAR 文件指定绝对路径名,或者相对于拥有 主机

使用 META-INF/context.xml 文件配置上下文时,不得设置此字段的值,因为自动部署过程会推断该值。

您的 URL 表明您希望将其放在 root 的文档库中。所以应该设置为/

This is described in Tomcat's Configuration Reference - The Context Container

docBase

The Document Base (also known as the Context Root) directory for this web application, or the pathname to the web application archive file (if this web application is being executed directly from the WAR file). You may specify an absolute pathname for this directory or WAR file, or a pathname that is relative to the appBase directory of the owning Host.

The value of this field must not be set when the Context is configured using a META-INF/context.xml file as it will be inferred by the automatic deployment process.

Your URL indicates that you want to have it on a document base of root. So it should be set to /.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文