前言:
除了JSF的配置文件 faces-config.xml 添加一些额外的代码外,没有其他特殊的
1.web.xml 核心代码
<!-- Spring -->
<listener>
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>
<!-- JSF config Start -->
<context-param>
<param-name>javax.faces.STATE_SAVING_METHOD</param-name>
<param-value>client</param-value>
</context-param>
<context-param>
<param-name>javax.faces.PROJECT_STAGE</param-name>
<param-value>Development</param-value>
</context-param>
<servlet>
<servlet-name>Faces Servlet</servlet-name>
<servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>Faces Servlet</servlet-name>
<url-pattern>*.faces</url-pattern>
</servlet-mapping>
<!-- JSF config End -->
2.JSF配置文件 faces-config.xml
<!-- 整合Spring 除此处外, 其他都是jsf的一般配置-->
<application>
<el-resolver>org.springframework.web.jsf.el.SpringBeanFacesELResolver</el-resolver>
</application>
<navigation-rule>
<from-view-id>/logon/logon.jsp</from-view-id>
<navigation-case>
<from-action>#{user.logonValidate }</from-action>
<from-outcome>logonSuccess</from-outcome> <!-- 对应bean文件内logonValidate方法d返回值 -->
<to-view-id>/logon/logonSuccess.jsp</to-view-id>
</navigation-case>
<navigation-case>
<from-action>#{user.logonValidate }</from-action>
<from-outcome>logonFailure</from-outcome> <!-- 对应bean文件内logonValidate方法d返回值 -->
<to-view-id>/logon/logon.jsp</to-view-id>
</navigation-case>
</navigation-rule>
3.spring配置文件
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd">
<!-- jsf的bean -->
<bean id="user" class="logon.UserBean" >
<property name="logonService" ref="logonService" />
</bean>
<bean id="logonService" class="logon.LogonService" >
<property name="logonDao" ref="logonDao" />
</bean>
<bean id="logonDao" class="logon.LogonDao" > </bean>
</beans>
4.其他文件 略;附件是完整的代码
分享到:
相关推荐
是一个全方位的应用程序框架(Application framework),除此之外,对于现存的各种框架(Struts、JSF、Hibernate 等),Spring 也提供了与它们相整合的方案。 本质上讲,Spring是IOC(Inversion of Control)和面向...
林信良学习笔记(内容):ajax学习笔记,算法学习笔记,计算机图形学,C++学习笔记,设计模式,Hibernate学习笔记,Java学习笔记,JSF,JSP/Servlet,JUnit,Spring,Struts等
SSH包括java,C++,算法,Window界面组建,JSF,Struts,Spring,Hibernate,JSPServlet,JUint,JavaC++从初学到高手的学习方法等经典极品不容错过!!
一分整理的学习笔记 里边包括了jsp,servlet,ejb,jsf,oracle,ajax,core jave struts,spring等各个方面的学习记录
常見程式演算,電腦圖學入門,設計模式,C 語言,GTK,C++,Qt3,Qt4,,Java (上),Java (下),JSP/Servlet,JSF,Ajax,JUnit,Struts,Spring,Hibernate,Acegi
Appfuse是Matt Raible 开发的一个指导性的入门级J2EE框架,它对如何集成流行的Spring、Hibernate、iBatis、Struts、xDcolet、Junit、Taperstry、JSF等基础框架给出了示范。在持久层,AppFuse采用了Hibernate O/R映射...
Appfuse是Matt Raible 开发的一个指导性的入门级J2EE框架,它对如何集成流行的Spring、Hibernate、iBatis、Struts、xDcolet、Junit、Taperstry、JSF等基础框架给出了示范。在持久层,AppFuse采用了Hibernate O/R映射...
int 32bit, -2^31~2^31-1 (2147483648,20亿,10位有效数字) long 64bit, -2^63~2^63-1 (900亿亿,20位有效数字) float 32bit, 9位有效数字,含小数(四舍五入)(小数点算一位,正负号不算) double 64bit, 18位...
自己整理的一些资料,不需要积分,希望对大家有帮助。 里面包有如下的一些java资料 Ant使用指南.pdf cvs.pdf Eclipse入门-- Eclipse的使用简介及插件开发.PDF ...spring2中文开发参考手册.chm a.txt
:hot_beverage: 描述Civilizer是用于笔记或个人知识管理(PKM)的Web应用程序工作所需的知识/专长/技巧/窍门临时备忘录/笔记时间表/计划您经常为琐事而忘记的详细过程例如,在计算机上安装打印机驱动程序,提交纳税...