在dir之外导航到素面的另一个目录中

问题描述 投票:1回答:1

我使用的模板带有撇号,但似乎无法正确解决。我一直收到500 error。我基本上是想从createorder.xhtml导航到WEB-INF/templates/fullpagetemplate.xhtml

我现在在createorder.xhtml中的路径是:

template="/WEB-INF/templates/fullpagetemplate.jsf"

我不断收到异常:

Servlet.service() for servlet Faces Servlet threw exception: javax.faces.view.facelets.TagAttributeException: /order/createorder.xhtml @7,53 <ui:composition template="/WEB-INF/templates/fullpagetemplate.jsf"> Invalid path : /WEB-INF/templates/fullpagetemplate.jsf

文件结构的屏幕截图:

Hello

jsf path facelets templating
1个回答
0
投票

您需要在文件路径前添加WEB-INF,这样才能导航到..目录,首先需要向上一个目录:

template="../WEB-INF/templates/fullpagetemplate.jsf"
© www.soinside.com 2019 - 2024. All rights reserved.