<ui: include src="/WEB-INF/templates/menubar. xhtml"/>
</div>
<! - BEGIN JAVASCRIPT - ->
<h: outputScript library="js" name="libs/jquery/jquery-1.11.2 min. js" target="head" />
<h: outputScript library="js" name="libs/jquery/jquery-migrate-1.2.1 min. js" target="head"/>
<h: outputScript library="js" name="libs/bootstrap/bootstrap. min. js" target="head"/>
<h: outputScript library="js" name="libs/spin. js/spin. min. js" target="head"/>
<h: outputScript library="js" name="libs/autosize/jquery. autosize. min. js" target="head"/>
<h: outputScript library="js" name="libs/nanoscroller/jquery. nanoscroller. min. js" target="head" />
<h: outputScript library="js" name="core/source/App. js" target="head"/>
<h: outputScript library="js" name="core/source/AppNavigation. js" target="head"/>
<h: outputScript library="js" name="core/source/AppOffcanvas. js" target="head"/>
<h: outputScript library="js" name="core/source/AppCard. js" target="head"/>
<h: outputScript library="js" name="core/source/AppForm. js" target="head"/>
<h: outputScript library="js" name="core/source/AppNavSearch. js" target="head"/>
<h: outputScript library="js" name="core/source/AppVendor. js" target="head"/>
<h: outputScript library="js" name="core/demo/Demo. js" target="head"/>
<! - END JAVASCRIPT - ->
</h: body>
</f: view>
</html>
journals. xhtml
<html xmlns="http://www.w3.org/1999/xhtml": h="http://xmlns. jcp.org/jsf/html"
xmlns: ui="http://xmlns. jcp.org/jsf/facelets": f="http://xmlns. jcp.org/jsf/core">
<f: view>
<h: head>
<title><ui: insert name="title"/></title>
<link href='http://fonts. googleapis.com/css? family=Roboto: 300italic,400italic,300,400,500,700,900' rel='stylesheet' type='text/css'/>
</h: head>
<h: body styleClass="menubar-hoverable header-fixed ">
<f: facet name="last">
<! - -<h: outputScript library="js" name="theme-default/bootstrap. css? 1422792965" target="head"/>-->
<h: outputStylesheet library="css" name="theme-default/bootstrap. css" />
<h: outputStylesheet library="css" name="theme-default/materialadmin. css" />
<h: outputStylesheet library="css" name="theme-default/font-awesome. min. css" />
<h: outputStylesheet library="css" name="theme-default/material-design-iconic-font. min. css" />
<h: outputStylesheet library="css" name="theme-default/main. css" />
</f: facet>
<! - HTML5 shim and Respond. js IE8 support of HTML5 elements and media queries - ->
<! - [if lt IE 9] >
<h: outputScript library="js" name="libs/utils/html5shiv. js" target="head"/>
<h: outputScript library="js" name="libs/utils/respond. min. js" target="head"/>
<! [endif] - ->
<header id="header">
<ui: include src="/WEB-INF/templates/header. xhtml"/>
</header>
<div id="base">
<! - BEGIN OFFCANVAS LEFT - ->
<div>>
</div><! - -end. offcanvas-->
<! - END OFFCANVAS LEFT - ->
<ui: include src="/WEB-INF/templates/searchTextImg. xhtml"/>
<ui: include src="/WEB-INF/templates/rightbar. xhtml"/>
<ui: include src="/WEB-INF/templates/menubar. xhtml"/>
</div>
<! - BEGIN JAVASCRIPT - ->
<h: outputScript library="js" name="libs/jquery/jquery-1.11.2 min. js" target="head" />
<h: outputScript library="js" name="libs/jquery/jquery-migrate-1.2.1 min. js" target="head"/>
<h: outputScript library="js" name="libs/bootstrap/bootstrap. min. js" target="head"/>
<h: outputScript library="js" name="libs/spin. js/spin. min. js" target="head"/>
<h: outputScript library="js" name="libs/autosize/jquery. autosize. min. js" target="head"/>
<h: outputScript library="js" name="libs/nanoscroller/jquery. nanoscroller. min. js" target="head" />
<h: outputScript library="js" name="core/source/App. js" target="head"/>
<h: outputScript library="js" name="core/source/AppNavigation. js" target="head"/>
<h: outputScript library="js" name="core/source/AppOffcanvas. js" target="head"/>
<h: outputScript library="js" name="core/source/AppCard. js" target="head"/>
<h: outputScript library="js" name="core/source/AppForm. js" target="head"/>
<h: outputScript library="js" name="core/source/AppNavSearch. js" target="head"/>
<h: outputScript library="js" name="core/source/AppVendor. js" target="head"/>
<h: outputScript library="js" name="core/demo/Demo. js" target="head"/>
<! - END JAVASCRIPT - ->
</h: body>
</f: view>
</html>
locales. xhtml
<html xmlns="http://www.w3.org/1999/xhtml": h="http://java. sun.com/jsf/html": ui="http://java. sun.com/jsf/facelets": f="http://java. sun.com/jsf/core": p="http://primefaces.org/ui">
<h: head>
<title>Facelet Title</title>
</h: head>
<h: body>
<ui: composition>
<div>>
<h: form>
<h: outputLink value="?">
<h: graphicImage library="images" name="rus. png" title="#{msg.russian}" width="21" height="20" style="margin-right: 10px"/>
</h: outputLink>
<h: outputLink value="?">
<h: graphicImage library="images" name="usa. png" title="#{msg. english}" width="21" height="15"/>
</h: outputLink>
</h: form>
</div>
</ui: composition>
</h: body>
</html>
search. xhtml
<html xmlns="http://www.w3.org/1999/xhtml": h="http://java. sun.com/jsf/html": ui="http://java. sun.com/jsf/facelets": f="http://java. sun.com/jsf/core": p="http://primefaces.org/ui">
<h: head>
<title>Facelet Title</title>
</h: head>
<h: body>
<ui: composition>
<! - BEGIN SEARCH BAR - ->
<div>>
<h: form>>
<div>>
<div>>
<div>>
<! - -<input type="text">
<div>>
<h: inputText id="searchInput" styleClass="form-control" value="#{searchCriteria. name}"/>
<script language="javascript">
document. getElementById ("search_form: searchInput"). setAttribute ("placeholder","#{msg. search}");
</script>
<div>></div>
</div>
<div>></div>
</div>
<div>>
<p: commandButton styleClass="btn btn-floating-action btn-default-bright fa fa-search" style="padding-top: 10px" icon=""="_eventId_searchByText">
<p: ajax execute="@form" render=": journals_form: journalsList"/>
</p: commandButton>
</div>
</div>
</div><! - -end. form-group - ->
</h: form>
</div><! - -end. card-body - ->
<! - END SEARCH BAR - ->
</ui: composition>
</h: body>
</html>
Приложение Ж. Конфигурация Spring
Webflow. xml
<? xml version="1.0" encoding="UTF-8"? >
<beans: beans="http://www.springframework.org/schema/webflow-config": beans="http://www.springframework.org/schema/beans": xsi="http://www.w3.org/2001/XMLSchema-instance": faces="http://www.springframework.org/schema/faces": schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans. xsd://www.springframework.org/schema/faces http://www.springframework.org/schema/faces/spring-faces. xsd://www.springframework.org/schema/webflow-config http://www.springframework.org/schema/webflow-config/spring-webflow-config. xsd
">
<flow-executor id="loginFlowExecutor"registry="flowRegistry" />
<flow-registry id="flowRegistry" flow-builder-services="flowBuilderServices" base-path="/WEB-INF/flows">
<flow-location-pattern value="*. xml" />
</flow-registry>
<faces: flow-builder-services id="flowBuilderServices" development="true" view-factory-creator="flowViewResolver" />
<! - A listener to create and release a FacesContext - ->
<beans: bean id="facesContextListener">/>
<flow-executor id="flowExecutor">
<flow-execution-listeners>
<listener ref="facesContextListener"/>
</flow-execution-listeners>
</flow-executor>
<beans: bean id="flowViewResolver"="org. springframework. webflow. mvc. builder. MvcViewFactoryCreator">
<beans: property name="viewResolvers">
<beans: list>
<beans: ref bean="viewResolver" />
</beans: list>
</beans: property>
</beans: bean>
</beans: beans>
DispatcherServlet. xml
<? xml version="1.0" encoding="UTF-8"? >
<beans xmlns="http://www.springframework.org/schema/beans": xsi="http://www.w3.org/2001/XMLSchema-instance": mvc="http://www.springframework.org/schema/mvc": context="http://www.springframework.org/schema/context": tx="http://www.springframework.org/schema/tx": schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans. xsd://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc. xsd http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context. xsd http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx. xsd">
<import resource="webflow. xml"/>
<context: component-scan base-package="wps. newsrussia"/>
<mvc: resources location="/" mapping="/resources/**"/>
<bean>>
<property name="flowRegistry" ref="flowRegistry"/>
</bean>
<bean name="resourceHandlerJSF">/>
<bean>>
<property name="order" value="1" />
<property name="mappings">
<value>
/javax. faces. resource/**=resourceHandlerJSF
</value>
</property>
</bean>
<bean>>
<property name="flowExecutor" ref="flowExecutor"/>
</bean>
<bean id="viewResolver">>
<property name="viewClass" value="org. springframework. faces. mvc. JsfView"/>
<property name="prefix" value="/WEB-INF/views/"/>
<property name="suffix" value=". xhtml"/>
</bean>
<bean id="msg">>
<property name="basename" value="WEB-INF/locales/messages"/>
<property name="defaultEncoding" value="UTF-8"/>
</bean>
<bean id="dataSource">>
<property name="jndiName" value="jdbc/newsrussia"/>
</bean>
<bean id="sessionFactory">>
<property name="dataSource" ref="dataSource"/>
<property name="configLocation" value="classpath: hibernate. cfg. xml"/>
</bean>
<tx: annotation-driven />
<bean id="transactionManager"="org. springframework. orm. hibernate4. HibernateTransactionManager">
<property name="sessionFactory" ref="sessionFactory" />
</bean>
<bean>>
<property name="attributes">
<map>
<entry key="newsrussiaFacade" value-ref="newsrussiaFacade"/>
</map>
</property>
</bean>
<bean id="localeResolver">>
<property name="defaultLocale" value="ru"/>
</bean>
<mvc: interceptors>
<mvc: interceptor>
<mvc: mapping path="/**/"/>
<bean>>
<property name="paramName" value="lang"/>
</bean>
</mvc: interceptor>
</mvc: interceptors>
</beans>
hibernate. cfg. xml
<? xml version='1.0' encoding='utf-8'? >
<! DOCTYPE hibernate-configuration PUBLIC
"- // Hibernate/Hibernate Configuration DTD // EN"
"http://www.hibernate.org/dtd/hibernate-configuration-3.0. dtd">
<hibernate-configuration>
<session-factory>
<property name="hibernate. dialect">org. hibernate. dialect. MySQLDialect</property>
<property name="hibernate. show_sql">true</property>
<property name="connection. url">jdbc: mysql: // localhost: 3306/newsrussia</property>
<property name="connection. driver_class">com. mysql. jdbc. Driver</property>
<mapping resource="wps/newsrussia/entities/Group. hbm. xml"/>
<mapping resource="wps/newsrussia/entities/Users. hbm. xml"/>
<mapping resource="wps/newsrussia/entities/Genre. hbm. xml"/>
<mapping resource="wps/newsrussia/entities/Storage. hbm. xml"/>
<mapping resource="wps/newsrussia/entities/Audio. hbm. xml"/>
<mapping resource="wps/newsrussia/entities/Digest. hbm. xml"/>
<mapping resource="wps/newsrussia/entities/DigestCover. hbm. xml"/>
<mapping resource="wps/newsrussia/entities/DigestIssues. hbm. xml"/>
<mapping resource="wps/newsrussia/entities/JournalCovers. hbm. xml"/>
<mapping resource="wps/newsrussia/entities/JournalIssues. hbm. xml"/>
<mapping resource="wps/newsrussia/entities/Journals. hbm. xml"/>
<mapping resource="wps/newsrussia/entities/Video. hbm. xml"/>
</session-factory>
</hibernate-configuration>