我使用 JSF 2.0 和 JSP 创建了 Web 应用程序,但遇到了一些奇怪的问题。
我在 JSF 中有一个包含 JSP 页面的页面。代码如下。
<o:resourceInclude path="detailedReports.jsp" />
其中 o 是全方位的。 xmlns:o="http://omnifaces.org/ui"
现在在 JSP (detailedReports.jsp) 中我有如下代码。
<h:form id="myForm" prependId="false">
<h:commandLink value="Take Me To Some Page" action="#{PersonalInformationDataBean.moveToApplicantRegisterPage()}" />
</h:form>
moveToApplicantRegisterPage()
有以下代码
public String moveToApplicantRegisterPage() {
editedData = 1;
return takeMeToAnotherPage("registerForPatentss");
}
当我点击 Take Me To Some Page
链接时,我被定向到 detailedReports.jsp
而不是 registerForPatentss.xhtml
。
发生这种情况的原因是什么?我应该怎么做才能重定向到 registerForPatentss.xhtml
。
注意:在重定向到registerForPatentss.xhtml
的同时,我还需要将int editedData
的数据设置为1
.
最佳答案
这可能是与混合两种不同的 View 技术(JSP 和 facelets)相关的呈现问题。
关于java - 奇怪的问题 : jsf inside jsp not working,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12694099/