ui:include can not include pages with different server context

后端 未结 1 897
半阙折子戏
半阙折子戏 2020-12-12 00:54

In my tomcat I have defined two context.

One is my application URL, which is

http://localhost:8080/mysite/faces/abc.xhtml

another one is

相关标签:
1条回答
  • 2020-12-12 01:19

    There are several options:

    1. Use <iframe> instead.

    2. Refactor the shared files into a separate web fragment project which should end up as JAR in /WEB-INF/lib of both webapps. Put the Facelets resources in the /META-INF/resources folder of the separate web fragment project. It'll be available for <ui:include> the usual way: Structure for multiple JSF projects with shared code.

    3. When on JSF 1.x, use a custom com.sun.facelets.impl.DefaultResourceResolver: How to use Facelets composition with files from another context.

    4. When on JSF 2.x, use a custom javax.faces.view.facelets.ResourceResolver: how to share a jsf error page between multiple wars.

    5. When on JSF 2.2+, use a custom javax.faces.application.ResourceHandler: Obtaining Facelets templates/files from an external filesystem or database.

    0 讨论(0)
提交回复
热议问题