随笔 - 571  文章 - 4  评论 - 253  阅读 - 72万

ADF_General JSF系列3_将JSP页面绑定到一个Managed Bean

2015-02-17 Created By BaoXinjian

一、摘要


本文介绍如何再JSF Application中创建和使用Bean

Step 1: Create a New Application and Project

Step 2: Create a JSF Page

Step 3: Create a Java Class

Step 4: Register the Class as a Managed Bean

Step 5: Design the UI

Step 6: Bind the UI to the Managed Bean

Step 7: Finish the Code and Run the JSF Page

 

1: Create a New Application and Project


Step1.  创建一个Custom Application

Step2.  查看所创建的Application

 

2: Create a JSF Page


Step1.  创建测试页面

 

Step2.  定义页面属性参数

 

3: Create a Java Class


Step1.  创建一个Java Class

Step2.定义Java Class的属性参数

Step3.  定义两个新参数username / email, 并产生get - set方法

Step4.  产生方法如下

 

4: Register the Class as a Managed Bean


Step1. 创建Managed Bean

Step2.  定义Managed Bean的属性参数

 

5: Design the UI


Step1.  设计测试页面

 

6: Bind the UI to the Managed Bean


Step1.  定义User name的绑定

Step2.  定义Email的值绑定

Step3.  定义Sign Me Up的触发方法

Step4.  编写Java包PersonInfo.java

 

7: Finish the Code and Run the JSF Page


Step1. 运行测试,输入Username和Email后点击按钮

 Step2. 系统通过system.output输出

 

Thanks and Regards

posted on   东方瀚海  阅读(201)  评论(0编辑  收藏  举报
编辑推荐:
· go语言实现终端里的倒计时
· 如何编写易于单元测试的代码
· 10年+ .NET Coder 心语,封装的思维:从隐藏、稳定开始理解其本质意义
· .NET Core 中如何实现缓存的预热?
· 从 HTTP 原因短语缺失研究 HTTP/2 和 HTTP/3 的设计差异
阅读排行:
· 周边上新:园子的第一款马克杯温暖上架
· Open-Sora 2.0 重磅开源!
· 分享 3 个 .NET 开源的文件压缩处理库,助力快速实现文件压缩解压功能!
· Ollama——大语言模型本地部署的极速利器
· DeepSeek如何颠覆传统软件测试?测试工程师会被淘汰吗?

点击右上角即可分享
微信分享提示