【发布时间】:2016-09-26 20:55:13
【问题描述】:
使用 Primefaces 6.0/jsf 2.2.6。
我有一个页面(安全),其中包括另一个页面(不安全,有 2 个进入不安全页面的入口点,因此此设置)由一个使用模板的 bean 支持,该模板在运行时确定,即:
所以第一个安全页面有:
<h:body>
<ui:include src="../unsecure/eacCalculator.xhtml" />
</h:body>
第二页:
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:p="http://primefaces.org/ui"
xmlns:pe="http://primefaces.org/ui/extensions"
xmlns:f="http://xmlns.jcp.org/jsf/core">
<h:head>
<script type="text/javascript">
$(document).on("keypress", ":input:not(text,textarea)", function (event) {
if (event.keyCode == 13) {
event.preventDefault();
}
});
</script>
</h:head>
<ui:composition template="#{eacCalculatorBean.template}" >
<f:event listener="#{eacCalculatorBean.getScreenStartupData()}" type="preRenderComponent" />
<ui:define name="page-content">
.......
如果我在从动态构建的菜单项登录后直接单击页面的 URL,则页面加载正常。但是,如果我先转到另一个页面,然后从那里再次单击上面页面的菜单项,它会加载一个空白页面。如果我重新单击菜单项,页面会再次重新呈现正常。
在另一个页面加载后第一次没有加载可能是什么原因?
【问题讨论】:
-
嗨,欢迎来到 stackoverflow。请创建一个minimal reproducible example。
-
菜单项是动态构建的,太复杂了
-
抱歉,但如果您无法创建minimal reproducible example(重现问题需要动态菜单吗?不能直接省略吗?)我怀疑有人能帮助您。 javascript是例如我认为肯定不相关
标签: primefaces jsf-2