Details for the Backing Bean Management of JSF

JSF中的Backing Bean详解
本文介绍了JavaServer Faces (JSF) 中的Backing Bean概念及其使用方法。通过示例展示了如何将组件对象封装到Backing Bean中,并探讨了其在表单处理中的作用。同时提醒开发者避免滥用UI组件作为业务数据存储。

Backing Beans

Sometimes, it is convenient to design a bean that contains some or all component objects of a web form. Such a bean is called a backing bean for the web form.For example, we can turn the BackingBean into a backing bean by adding properties or updating properties for the component you need on the form like this as follow:

edit.jsp:

 

BackingBean.java:


 

 

When the component tree for the form is built, the getComponent method of the backing bean is called, but it returns null. As a result, an output component is constructed and installed into the backing bean with a call to setComponent.

Backing beans have their uses, but they can also be abused. You should not use the user interface components as a repository for business data. If you use backing beans for your forms, you should still use beans for business objects.

I believe that it will help you above materials and need your help to continue.....

 





































评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值