JavaServer Faces™ 基本觀念 廖峻鋒台大資工所 July 17,2006 Intelligent Space 國立台灣大學資訊工程研究所 智慧型空間實驗室.

Slides:



Advertisements
Similar presentations
第 4 章 配合 例子源代码一起使用 Power point 制作:耿祥义 张跃平 普通高等教育 “ 十一五 ” 国家级规划教材 JSP 内置对象.
Advertisements

LOGO 第 9 章 Java Servlet 和 JSP 编程 孙焘. 重点: servlet 编程原理 1 servlet 的基础类与编程实现 2 JSP 编程原理 3 JSP 的常用语法 4.
2016年8月29日 2016年8月29日 2016年8月29日 复旦大学 2006 年春 参考 TOPICS.
第 9 章 测试部署  9.1 测试  9.2 部署. 9.1 测试  应用测试:使用 JUnit 单元测试框架 测试的目的是检验开发结果是否满足规定需求,测试是保证软件质量的一个重要手段, 在软件开发过程中是不可缺少的组成部分。 单元测试与集成测试分别有各自的定义:在实际开发中,两者之间的界定是模糊的。
第 7 章 配合 例子源代码一起使用 Power point 制作:耿祥义 张跃平 普通高等教育 “ 十一五 ” 国家级规划教材 JSP 与 JavaBean.
Power point 制作 耿祥义 张跃平 配合 例子源代码一起使用. 第 5 章 JSP 与 JavaBean JavaBean 是一个可重复使用的软件组件, 是遵循一定标准、用 Java 语言编写的一 个类,该类的一个实例称为一个 JavaBean ,简称 bean.
淮海工学院 计算机课程 第 1 章 Java 入门 1.1 Java 的起源与发展 1.2 Java 程序开发与运行环境 1.3 Java 程序设计步骤 1.4 Java 程序的构成 一个小游戏.
动态网站开发 【HTTP与网络基础】 李博杰
HE Fixed Assets Manage System
第16章 代理模式 Website:
动态Web开发技术--JSP.
第一章 JSP概述.
国家科学图书馆: 刘丹军、赵雅娟、王晓梅、胡正银等 创想通科技: 阎武鹏 等 2010年 洛阳
上节课我们是讲解了request, response, session, application 等内置对象,有了它们,我们就可以编写一个完整的应用程序了。 我们来看ebank这个小应用程序的编写。
Java程序设计教程 第一讲 Java概述.
SAE Java 实际应用 在这里写上你的标题 作者名字/日期
基于SSH的web开发 AND 企业级WEB应用开发新技术
IT职业发展趋势及未来 美国 .杰普软件科技有限公司
第一页是课程的标题 Spring入门示例.
MVC Servlet与MVC设计模式.
攻击JAVA WEB 阿里巴巴集团安全中心 周拓.
J2EE Struts 和Spring 的区别.
建设数字化的卫生监督体系 深 圳 市 卫 生 监 督 所 2006年4月.
創新商業模式應用大賽 指導: 研華文教基金會 【北區初賽】 主辦: 國立 交通大學 國立清華大學 執行: 創新育成中心 【南區初賽】
大型主机应用上的开放系统和中间件 2011年度教育部-IBM精品课程
精英型软件人才 培养模式的探索与实践 卢 苇 北京交通大学国家示范性软件学院.
第八章 分析與設計階段 – 物件導向設計(OOD)
针对多租户应用程序的 JVM 支持 提高应用程序密集性
Topics 應用架構 學習路徑 熱門議題 相關認證.
mashup 林維甫 郭家伶 吳佩珊 蔡小倩 楊士毅 曾仕豪 Marshup起源 何謂Mashup Mashup類型 Mashup架構
集成 与 jQuery 和 Bootstrap Michael Isvy.
Hello World 體驗實作第一個JSP程式.
Microsoft .NET 第4組 十月15, 2002 B 陳東傑 B 蔣佳勳
PowerBuilder战略方向. PowerBuilder战略方向 应用开发的基本途径 Other 13% 3GLs 4GL/RAD 23% 36% OO 3GLs Source: IDC 28%
软件设计模式与体系结构课程设计 周 宇 College of Information Science and Technology
Asp.net 基礎.
PC2 安裝說明文件 2018/11/12.
J2EE 培训课程.
数据库操作示例 import java.sql.*; //导入java.sql包 public class JDBCDemo {
专题4:JSP脚本和指令.
Mobile & Embedded DevCon 2005 朱敏博士 微软有限公司
Arena System Technology Architecture 系统技术架构 1、Database V2(Lotus Notes)V3(Oracle8i) 2、Application Server SilverStream2.53 (Java as server side programming.
J2EE Course 2018/11/20.
第六章 窗口系统和用户界面管理系统 山东大学计算机学院.
第一章 電腦、程式與JAVA.
高级Web技术 复 习.
JBOSS安装配置及WebWork的集成
SAP 架構及基本操作 SAP前端軟體安裝與登入 Logical View of the SAP System SAP登入 IDES
简单的介绍,简单的配置,简单的扩展 By jfm
软件服务生态中的非确定性科学问题、互操作性的应用基础问题
Spring依赖注入及AOP简介.
DWR WEB开发交流 1、自我介绍 2、DWR概述 3、DWR DEMO介绍 4、DWR实现机制 5、DWR配置说明 6、JS开发注意事项.
第一讲 J2EE基础 博和利初级培训 —开发技能.
第11章 系统结构与包模型模型.
Dr. Ming Qiu Xiamen University Software School
利用 ASP.NET MVC 提升您的 Web 應用程式
电子商务 王素凤
第1章 Java语言概述 学习目标 本章要点 上机练习 习 题.
SDA(Standard development architecture)框架介绍
基于struts和hibernate的网上新 闻发布系统
Java Server Faces 参考书籍 Java Server Faces 核心编程.
Node.js专题 (2) 做一个留言板 2017/3/24 – Payne
模式与实践:Windows Mobile 5.0应用程序架构
SAP 架構及基本操作 SAP前端軟體安裝與登入 Logical View of the SAP System SAP登入 IDES
React.js.
案例分析: THE NEXTGEN POS SYSTEM
----以《西北民族音乐学术资源数据库》为例 西安音乐学院 景 月 亲
PureMVC 孙晓申.
第21章 Spring 的MVC框架 Spring不但一个很好的集成框剪,它还提供了构建Web应用程序的全功能MVC模块。Spring 的MVC框架非常强大并不逊色于其他专业的Web框架,如Struts、WebWork。但在国内Spring MVC应用的并不是特别多,原因可能是Struts太深入人心的缘故吧。
高擴充高穩定高安全 企業級資料管理平台 Report Builder概論 錢曉明 資策會 資深講師 台灣微軟 資深講師.
Presentation transcript:

JavaServer Faces™ 基本觀念 廖峻鋒台大資工所 July 17,2006 Intelligent Space 國立台灣大學資訊工程研究所 智慧型空間實驗室

Intelligent Space 國立台灣大學資訊工程研究所 智慧型空間實驗室 JavaServer Faces™ 基本觀念 Self Intro  廖峻鋒 (try) 台大資工所博士班 SCJP / SCWCD Core JavaServer Faces 中譯本 審校人 RUN! PC 特約作者 (2006/ /12 on AJAX / Java EE 5.0)   WWW:

Intelligent Space 國立台灣大學資訊工程研究所 智慧型空間實驗室 JavaServer Faces™ 基本觀念 JavaServer Faces  A Web Framework Standard Struts / Tapestry / Web Works… 都不是標準 Web Frameworks  Server-side UI Component Model (AJAX: Client- side)  Competitor with Microsoft ASP.NET’s WebForms.

Intelligent Space 國立台灣大學資訊工程研究所 智慧型空間實驗室 JavaServer Faces™ 基本觀念 架構選擇 (1) JSF+Spring+Hibernate Domain Objects JSP / JSTL Struts Action / View Helper Service Fa ç ade / Business Delegate Business Services and Components DAO Hibernate / JDBC Struts Spring JavaServer Faces

Intelligent Space 國立台灣大學資訊工程研究所 智慧型空間實驗室 JavaServer Faces™ 基本觀念 架構選擇 (2) J2EE 1.4 Service Fa ç ade / Business Delegate Stateless Session Beans / Message-Driven Beans Entity Beans EJB Container JavaServer Faces Web Container

Intelligent Space 國立台灣大學資訊工程研究所 智慧型空間實驗室 JavaServer Faces™ 基本觀念 架構選擇 (3) Java EE 5 Persistable POJOs Service Fa ç ade / Business Delegate Stateless Session Beans / Message-Driven Beans Java Persistence API EJB Container JavaServer Faces Web Container

Intelligent Space 國立台灣大學資訊工程研究所 智慧型空間實驗室 JavaServer Faces™ 基本觀念 架構選擇 (4) JSF + Spring JPA Persistable POJOs Service Fa ç ade / Business Delegate Java Persistence API JavaServer Faces Business Services / MD-POJOs DAO Spring

Intelligent Space 國立台灣大學資訊工程研究所 智慧型空間實驗室 JavaServer Faces™ 基本觀念 JSF 的 定位

Intelligent Space 國立台灣大學資訊工程研究所 智慧型空間實驗室 JavaServer Faces™ 基本觀念 Lab  (please refer to jsf-worksheet1.pdf)

Intelligent Space 國立台灣大學資訊工程研究所 智慧型空間實驗室 JavaServer Faces™ 基本觀念 系統需求  JDK 以上  Web Application Container Servlet 2.3/JSP 1.2 以上  JSF RI

Intelligent Space 國立台灣大學資訊工程研究所 智慧型空間實驗室 JavaServer Faces™ 基本觀念 Adding JSF Support <web-app> Faces Servlet javax.faces.webapp.FacesServlet 1 Faces Servlet *.faces </web-app>

Intelligent Space 國立台灣大學資訊工程研究所 智慧型空間實驗室 JavaServer Faces™ 基本觀念 JSF’s MVC Architecture

Intelligent Space 國立台灣大學資訊工程研究所 智慧型空間實驗室 JavaServer Faces™ 基本觀念 Request / Response Lifecycle

Intelligent Space 國立台灣大學資訊工程研究所 智慧型空間實驗室 JavaServer Faces™ 基本觀念 Face Binding JSF Page Id: __________ Password:____ Submit Backing Bean class LoginForm { private String id; private String password; …… public String login(){ … } #{loginForm.id} #{loginForm.password} #{loginForm.login}

Intelligent Space 國立台灣大學資訊工程研究所 智慧型空間實驗室 JavaServer Faces™ 基本觀念 Face Binding (faces-config.xml) <managed-bean> loginForm loginForm com.esun.jsf.LoginForm com.esun.jsf.LoginForm session session

Intelligent Space 國立台灣大學資訊工程研究所 智慧型空間實驗室 JavaServer Faces™ 基本觀念 Face Binding <f:view><h:form> </h:form></f:view> .一切Tag必須含在f:view之中 .#{}代表JSF Binding, #{}中為EL (Expression Language) action / actionListener / valueChangeListener

Intelligent Space 國立台灣大學資訊工程研究所 智慧型空間實驗室 JavaServer Faces™ 基本觀念 Face Binding  Method Bindings  Method Bindings  Value Change Listeners  Value Change Listeners  Command Actions  Command Actions  Action Listeners  Action Listeners

Intelligent Space 國立台灣大學資訊工程研究所 智慧型空間實驗室 JavaServer Faces™ 基本觀念 Page Navigation JSF Page Id: __________ Password:____ Submit Login Fail … (error messages) Your Account ID: Name: Alex Tel: … failure success

Intelligent Space 國立台灣大學資訊工程研究所 智慧型空間實驗室 JavaServer Faces™ 基本觀念 Page Navigation /login.jsp success /account.jsp failure /error.jsp

Intelligent Space 國立台灣大學資訊工程研究所 智慧型空間實驗室 JavaServer Faces™ 基本觀念 Dependency Injection (User Code) CustomerService customerDao LoginForm customerService CustomerDaoHibernateImpl FormFactory inject new

Intelligent Space 國立台灣大學資訊工程研究所 智慧型空間實驗室 JavaServer Faces™ 基本觀念 Dependency Injection (Container) CustomerService customerDao LoginForm customerService CustomerDaoHibernateImpl Container inject new Inversion of Control !

Intelligent Space 國立台灣大學資訊工程研究所 智慧型空間實驗室 JavaServer Faces™ 基本觀念 Face Binding (faces-config.xml) <managed-bean> loginForm loginForm com.esun.jsf.LoginForm com.esun.jsf.LoginForm session session customserService customserService #{customerService} #{customerService} <managed-bean> customserService customserService com.esun.logic.CustomerService com.esun.logic.CustomerService session session </managed-bean>

Intelligent Space 國立台灣大學資訊工程研究所 智慧型空間實驗室 JavaServer Faces™ 基本觀念 JSF Books  JavaServer Faces in Action  Core JavaServer Faces ( 有中譯本 )  Mastering JSF  Oreilly JSF ( 有中譯本 )  Pro JSF and Ajax: Building Rich Internet Components

Intelligent Space 國立台灣大學資訊工程研究所 智慧型空間實驗室 JavaServer Faces™ 基本觀念 Backup

Intelligent Space 國立台灣大學資訊工程研究所 智慧型空間實驗室 JavaServer Faces™ 基本觀念 JSF 的歷史  May 30,2001 JSR-127  Mar 3, 2004 JSF 1.0  Apr 2, 2004 JSF 1.0 RI  May 27, 2004 JSF 1.1

Intelligent Space 國立台灣大學資訊工程研究所 智慧型空間實驗室 JavaServer Faces™ 基本觀念 JSF: High-Level Overview

Intelligent Space 國立台灣大學資訊工程研究所 智慧型空間實驗室 JavaServer Faces™ 基本觀念 What is JavaServer Faces ?  An extensible component model.  A set of prefabricated UI components.  An event-driven programming model.

Intelligent Space 國立台灣大學資訊工程研究所 智慧型空間實驗室 JavaServer Faces™ 基本觀念 Restore View

Intelligent Space 國立台灣大學資訊工程研究所 智慧型空間實驗室 JavaServer Faces™ 基本觀念 Apply Request Values

Intelligent Space 國立台灣大學資訊工程研究所 智慧型空間實驗室 JavaServer Faces™ 基本觀念 Process Validations

Intelligent Space 國立台灣大學資訊工程研究所 智慧型空間實驗室 JavaServer Faces™ 基本觀念 Update Model Values

Intelligent Space 國立台灣大學資訊工程研究所 智慧型空間實驗室 JavaServer Faces™ 基本觀念 Invoke Application

Intelligent Space 國立台灣大學資訊工程研究所 智慧型空間實驗室 JavaServer Faces™ 基本觀念 Render Response