Java Virtal Machine.net

[ News ] rss

February 01, 2011

Mark Wielaard: New GPG key. Finally created a new GPG key using gnupg. The old one was a DSA/1024 bits one and 8 years old. The new one is a RSA/2048 bits one. I will use the new one in the future to sign any release tarballs I might create. pub 2048R/57816A6A 2011-01-29 Key f...

More »

February 01, 2011

Andrew Hughes: [SECURITY] IcedTea6 1.7.8, 1.8.5, 1.9.5 Released!. We are pleased to announce a new set of security releases, IcedTea6 1.7.8, IcedTea6 1.8.5 and IcedTea6 1.9.5. This update contains the following security updates: The IcedTea project provides a harness to build the source code from OpenJDK6 u...

More »

December/2024
SunMonTueWedThuFriSat
1234567
891011121314
15161718192021
22232425 262728
293031    

[ Archives News
for 'Java Technology' ]

home > news > java technology > how to stay away from the jsf api

How to stay away from the JSF API

A few weeks ago, Ed Burns posted a link to a blog on the JSF expert group mailing list, commenting “A nice one, but it doesn't mention JSF 2”. Ever the curmudgeon, I pointed out that it wasn't so nice that the blog's sample code used the JSF API in beans when it wasn't necessary—as does in fact a lot of sample code, even in the official Sun tutorials. Ed's response: “Cay, a blog comment by such an eminent citizen as yourself would certainly be noticed.” So, here is the curmudgeonly eminence's advice on how to stay away from the JSF API. To set the stage, recall the basic mechanism by which JSF links the visual presentation with the application logic. JSF pages are composed of component tags that contain expressions in the oh-so-blandly named Expression Language (EL). For example, The class of the userBean object must have getters and setters for the password property: @Named public class UserBean { public String getPassword() { ... } public void setPassword(String newValue) { ... } ... } Here, the property has the type String, and that is good. There is no coupling between the UserBean class and the JSF API. You can compile and run unit tests of UserBean without having JSF around. You can even (gasp) switch to another view technology. So, where do programmers go wrong? Mainly in these four areas: SelectItem Data tables UIComponent The @ManagedB...


Date: January, 03 2010
Url: http://www.java.net/blog/cayhorstmann/archive/2010/01/03/how-stay-away-jsf-api


Others News

©2002-2019Java-Virtual-Machine.net web editor | top web builder | top free website builder | free icon maker | easyhtml5video.com