对于 JSF,找不到子上下文请求的资源

发布于 2024-09-24 08:19:37 字数 847 浏览 0 评论 0原文

我的 JSF 应用程序部署在 tomcat 下,并且我的应用程序的 server.xml 配置如下。

   <Host name="myapp.com" appBase="/home/myapp/public_html">
      <Alias>www.myapp.com</Alias>
      <Context path="" reloadable="true" docBase="/home/myapp/public_html" debug="1"/>
      <Context path="/manager" debug="0" privileged="true" docBase="/usr/local/jakarta/tomcat/server/webapps/manager">
      </Context>
   </Host>

通过这些设置,我可以访问“web”文件夹下的所有页面。当我尝试使用以下 URL 访问“app”下的某些可用页面时,我在“web”下有“app”文件夹,并且在“app”下有几个 jsp 页面: www.myapp.com/app/ test_page.jsf,我收到“找不到请求的资源”

我需要在 Tomcat 的 Server.xml 中进行哪些更改才能使其正常工作。

我是否需要为“app”子上下文添加上下文路径,如下所示在 Server.xml 中:

<Context path="/myapp/app" reloadable="true" docBase="/home/myapp/public_html/app" debug="1"/>

My JSF application is deployed under tomcat and server.xml is configured as follows for my application

   <Host name="myapp.com" appBase="/home/myapp/public_html">
      <Alias>www.myapp.com</Alias>
      <Context path="" reloadable="true" docBase="/home/myapp/public_html" debug="1"/>
      <Context path="/manager" debug="0" privileged="true" docBase="/usr/local/jakarta/tomcat/server/webapps/manager">
      </Context>
   </Host>

With these settings I can access all the pages under 'web' folder. I have 'app' folder under 'web' and I have couple of jsp pages under 'app', when I try to access some pages available under 'app' with the following URL: www.myapp.com/app/test_page.jsf, I get 'requested resource cannot be found'

What are the changes I need to do in Tomcat`s Server.xml to get this working.

Do I need to add context path for the 'app' subcontext like this mentioned below in Server.xml:

<Context path="/myapp/app" reloadable="true" docBase="/home/myapp/public_html/app" debug="1"/>

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

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

发布评论

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

评论(1

花桑 2024-10-01 08:19:37

假设 /web 文件夹位于 /public_html 文件夹中,您需要将 /web 文件夹包含在 appBase 中> 和 docBase,或在 URL 中。

Assuming that /web folder is placed in /public_html folder, you need to include the /web folder in either appBase and docBase, or in URL.

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