我正在使用JSF + Spring Webflow和himnate与Primfaces。
现在我有一个布局,其中定义了3个layoutunit(north
,west,center)。每当我调用一个页面时,它会重新加载整个页面而不是中心layoutunit。
<!-- <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" -->
<!DOCTYPE html>
<html lang="en-US" xmlns:h="http://java.sun.com/jsf/html"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:c="http://java.sun.com/jsp/jstl/core"
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:beas="http://beas.com/facelets"
xmlns:p="http://primefaces.org/ui">
<f:view contentType="text/html">
<ui:define name="headerIncludes">
</ui:define>
<h:head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<h:outputStylesheet name="bootstrap/css/bootstrap.css" />
<h:outputStylesheet name="bootstrap/css/bootstrap-responsive.css" />
<h:outputStylesheet name="bootstrap/css/bootStrapStyle.css" />
<h:outputStylesheet name="bootstrap/css/configuration_Agent.css" />
<h:outputStylesheet name="bootstrap/css/emaven_aggregator.css" />
<!-- Responsive CSS Link Ends -->
<style>
body {
background: #ffffff url("../resources/images/loading.gif");
background-repeat: no-repeat;
background-attachment: fixed;
background-position: center;
width: 100%;
overflow: hidden;
}
</style>
<ui:insert name="headerIncludes" />
</h:head>
<h:body style="color: #616161;margin: 0;padding: 0;"
styleClass="dashboard-body">
<p:layout fullPage="true">
<p:layoutUnit position="center" style="border-radius: 0;"
id="mainLayout">
<p:layout closeTitle="Close" collapseTitle="Collapse"
expandTitle="Expand">
<!-- LEFT MENU Content Ends -->
<p:layoutUnit position="west" resizable="false" size="50"
minSize="20" maxSize="100"
styleClass="left_menu_area ui-widget-header">
<ui:repeat var="menu" value="#{menuScreenTransformer.parentMenu}">
<h:form id="menus">
<!-- #{!managePatientTO.clinicBoolean?'switcher_clinical':'switcher_nonclinical'} -->
<p:commandButton id="home"
styleClass="hvr-overline-from-left #{menu.menuImage} ui-state-default"
icon="" title="#{menu.menuDesc}"
actionListener="#{flowManager.performPageAction(menu.childflag?(menu.screenName):'null')}" />
<p:tooltip id="toolTipFocus" for="home" value="#{menu.menuDesc}" />
<p:menu overlay="true" trigger="home" triggerEvent="mousedown"
rendered="#{!menu.childflag}" my="right top" at="left top"
toggleable="false" styleClass="mapping_menue"
style="width:300px; !important;"
model="#{menuScreenTransformer.fetchMenuModel(menu.menuID)}" />
</h:form>
</ui:repeat>
<!-- <ui:repeat var="submenu" value="#{menu.list}" >
<!-- <p:separator styleClass="footer_separator" style="width:95% !important;"></p:separator> -->
<!-- </div> -->
</p:layoutUnit>
<!-- LEFT MENU Content Ends -->
<p:layoutUnit position="north" maxSize="80" minSize="50"
visible="true" header="abc" rendered="true"
style=" overflow: hidden;" styleClass="borderHeaderLine">
<!--lock screen -->
<h:form id="dialogInputForm">
</h:form>
<h:form id="menuForm">
<p:outputPanel id="page" autoUpdate="true" layout="block">
<!-- <h:panelGrid columns="3" width="100%"
columnClasses="headerCol1Style,headerCol2Style,headerCol3Style"> -->
<div class="container-fluid">
<div class="row-fluid header-row">
<div class="span12">
<div class="span3">
<p:outputPanel layout="block">
<p:graphicImage
value="#{pageContext.request.contextPath}/resources/images/edios.png"
rendered="#{loginApp.applicationLogo != 'L2'}"
style="max-height:52px;" />
<p:graphicImage
value="#{pageContext.request.contextPath}/resources/images/velos_logo.png"
rendered="#{loginApp.applicationLogo == 'L2'}"
style="max-height:52px;" />
<p:spacer
rendered="#{applicationManager.appParameter.appLogoPath == ''}" />
</p:outputPanel>
</div>
<div class="span6">
<h:panelGrid columns="1" width="100%"
styleClass="header-heading-class">
<p:outputPanel layout="block"
styleClass="tag-line header-heading-class">
<h:outputText
value="#{appLoginParameter['BayaTreeAppHeader']}"
rendered="#{loginApp.applicationLogo != 'L2'}" />
<h:outputText
value="#{appLoginParameter['VelosAppHeader']}"
rendered="#{loginApp.applicationLogo == 'L2'}" />
</p:outputPanel>
<p:outputPanel layout="block"
styleClass="login-body version-div"
style="text-align:center;width:100%;">
<h:outputText value="#{appLoginParameter['Version']}"></h:outputText>
<h:outputText value="#{loginApp.serviceEnvironment}" />
</p:outputPanel>
</h:panelGrid>
</div>
<div class="span3">
<div class="right_menu top_right_menu">
<!-- <a class="tooltips2" > -->
<p:button id="UserInfo" icon="fa fa-user fa-lg"
styleClass="users_setting" />
<!-- </a> -->
<p:commandButton id="accsetting" icon="fa fa-cog fa-lg"
styleClass="settings"
actionListener="#{flowManager.performPageAction('ACCOUNT_SETTINGS')}"
onclick=" PF('dlg').show();" />
<p:tooltip id="toolTipFade1" for="accsetting"
value="#{appLabel['accountSettings']}" />
<p:commandButton id="logout" icon="fa fa-power-off fa-lg"
styleClass="user_logout" action="signOut"
actionListener="#{manageLayout.checkFlagForLogout}"
onclick=" PF('dlg').show();" />
<p:tooltip id="toolTipFade2" for="logout"
value="#{appLabel['logOut']}" />
</div>
<!-- Right Menu Ends -->
</div>
</div>
</div>
</div>
</p:outputPanel>
</h:form>
</p:layoutUnit>
<p:layoutUnit position="center">
<div class="unsupported_res">ediosPRS Web Application does
not support this Resolution.</div>
<h:form id="menu">
<p:commandButton id="sessionTimeOut" action="autoLogout"
actionListener="#{manageLayout.checkFlagForLogout}"
onclick=" PF('dlg').show();" style="display:none;" />
<!-- <p:menubar model="#{menuScreenTransformer.menuModel}" widgetVar="menu"
styleClass="menuhome " autoDisplay="false" /> -->
<!-- ui-widget-content ui-state-default -->
</h:form>
<h:form id="form">
<p:outputPanel layout="block" id="centerPanel">
<p:growl id="globalGrowl" autoUpdate="true"
widgetVar="globalGrowl" life="#{appLabel['MsgAutoCloseTime']}" />
<ui:insert name="content" />
<p:idleMonitor
timeout="#{sessionManager.userLoginDetailTO.sessionTimeoutMin*60000-appLabel['startTimerSessionTimeout']*1000}">
<p:ajax event="idle" onstart="PF('idleDialog').show();" />
</p:idleMonitor>
<p:dialog header="#{appLabel['sessionExpire']}"
widgetVar="idleDialog" showEffect="fade" hideEffect="fade"
modal="true" width="580" height="100" closable="false"
draggable="false" resizable="false"
onShow="startTimer(#{appLabel['startTimerSessionTimeout']})"
appendTo="@(body)">
<div class="text_container_box">
<div class="message_of_use1">
<div class="message_display_div_time_out">
<span class="ui-icon ui-icon-alert" style="float: left;"></span>
<span> #{appMessage['loggedOffTimeMessage']} <span
id="dialog-countdown" style="font-weight: bold"></span>
#{appMessage['secondsMessage']}
</span> <span> #{appMessage['continueSessionMessage']} </span> <span
class="timed_out_buttons"> <p:commandButton
value="#{appLabel['keepWorking']}"
onclick="clearTimeInterval()" /> <p:spacer width="8"></p:spacer>
<p:commandButton value="#{appLabel['logOutSession']}"
onclick="logOff()" />
</span>
</div>
</div>
</div>
</p:dialog>
<p:overlayPanel id="overLayId" for="menuForm:UserInfo"
showEffect="fold" hideEffect="fold" showEvent="mouseover"
hideEvent="mouseleave" dismissable="true"
styleClass="overlaypanel" style="width:220px; height:150px;">
<p:outputLabel value="#{appLabel['L_User_Name']}"
style="font-weight: bold;"></p:outputLabel>
<p:outputLabel
value="#{sessionManager.userLoginDetailTO.firstName} #{sessionManager.userLoginDetailTO.lastName} "
style="width:100%; padding-left:10px;"></p:outputLabel>
<p:outputLabel value="#{appLabel['Login_Name_Group_Name']}"
style="font-weight: bold; margin-top:10px;"></p:outputLabel>
<p:outputLabel
value="#{sessionManager.userName} (#{sessionManager.userLoginDetailTO.defaultGroupName}) "
style="width:100%; padding-left:10px;"></p:outputLabel>
<!-- <p:outputLabel value=""></p:outputLabel> -->
<p:outputLabel value="#{appLabel['lastLoggedInDateAndTime']}"
style=" font-weight: bold;width:100%; margin-top:10px;">
<f:convertDateTime
pattern="#{sessionManager.defaultDateFormat} #{sessionManager.defaultTimeFormat}" />
</p:outputLabel>
<p:outputLabel id="lastLogedDateID"
value="#{securityManager.getLastLoggedInTimeOfUser()}"
style="width:100%; padding-left:10px;">
<f:convertDateTime
pattern="#{sessionManager.defaultDateFormat}"
for="lastLogedDateID" style="width:100%;" />
</p:outputLabel>
</p:overlayPanel>
</p:outputPanel>
</h:form>
</p:layoutUnit>
</p:layout>
</p:layoutUnit>
<beas:progress progressId="dlgForMenuClick" />
</p:layout>
</h:body>
</f:view>
</html>
`using this properties in POM.xml
<properties>
<spring.version>3.0.5.RELEASE</spring.version>
<org.slf4j-version>1.5.10</org.slf4j-version>
<org.springframework-version>3.0.5.RELEASE</org.springframework-version>
<org.springsecurity-version>3.0.2.RELEASE</org.springsecurity-version>
<spring-webflow-version>2.3.2.RELEASE</spring-webflow-version>
<jsf-version>2.1.3</jsf-version>
<primefaces-version>5.2</primefaces-version>
<theme.version>1.0.10</theme.version>
</properties>`