对于 JSF,找不到子上下文请求的资源
我的 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
假设
/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 eitherappBase
anddocBase
, or in URL.