JSF, Bajiudian bell morning sun rising
Abstract: JSF, Bajiudian bell morning sun rising
</ Td> </ tr> <tr> <td height="35" valign="top" class="ArticleTeitle"> <table width = "100%" border = "0" cellspacing = "0" cellpadding = " 0 "> <tr> <td width="505" height="86" align="left" valign="top"> Abstract: JavaServer Faces, as a new Web presentation layer framework, are being more and more attention . This paper describes several advantages of the JSF, as well as these advantages brought about by the development of the Web major changes to the JSF will be to many competitors come to the fore, a Web presentation layer framework of the mainstream.
1. Introduction: I JSF and the first intimate contact
In March 2004, when I started my first developed a Web program, I chose the JSP. As a traditional desktop programmer, and the old programmers, Web programmers to change is very painful. Three month's time, finally completed the process, but from the JSP core. Tousled writing format, data, and the hybrid interface, in particular, embedded in the pages Scriptlet, let me confuse themselves or written procedures for the website.
Therefore, when receiving the second edition of the development tasks, I did not hesitate to abandon the JSP, to find an alternative technologies. An Internet search, they found that the framework Cheruniumao, commentary 1960, with no consensus, I completely lost. Hesitate wavering when the sun J2EE Tutorial documents on JavaServer Faces technology introduced to me: UI, component, the event, these desktop listener familiar with the wording of the procedure, let me in the development of Web programmers find the desktop Some feel.
Like the development of desktop applications as web development process, this is my choice JSF's original intentions. Based on this superficial understanding, staggering along the road, the construction period and new technology under the dual pressures, the work is hard overload, but often excavated from the JSF in a surprising new features, has given me to bring to the great satisfaction. Second edition was completed, the calendar just turn a whole month. JSF is the efficiency significantly.
In fact, up to now, I can only say that the JSF is a preliminary understanding, far from grasp, let alone master, but that does not hinder me for the JSF as the preferred Web development framework. Especially for the novice, if not in Struts, Tiles, Spring, Tapestry, such as going too far in the framework, then you concentrate on a limited set foot on the road it JSF.
2. JSF advantages: UI components (UI-component)
UI components (UI-component) desktop procedure has been patented, web procedures, although the definition of the basic HTML tags UI, but to make these labels like UI UI components as work, but also requires a lot of code to handle data and clips manifestations, but also effectively organize these code fragments it is a concerted tedious work. JSF UI component is the real meaning of the UI components, can greatly simplify the work of programmers, for example, to place pages in a text input box, the input box filled immediately with the data, interface updates, incident interception , action trigger, validity checks and conversion functions. More importantly, the programmer simply based on business logic code prepared by the core business, the JSF will be guaranteed at the right time code was implemented, not fully consider the code between the code and how to cope with. </ Td> <td width="179" valign="top"> </ td> </ tr> </ table>
3. Advantage of the JSF 2: event-driven model
Object-oriented methods incident is an important component of the object passed between the incident and the exchange of communication, making one or more objects to the conduct of another object in response to work together to complete a business logic. Usually, the preparation of Web program, targeted at programmers to design the communication mechanism between the preparation of the code. Although the content of communication is business logic, but the mechanism for communication with the business apparently do not have much, so programmers for the business logic of the function of a waste of time. JSF has changed the situation. JSF events and listening mode and we are familiar with the incident Javabean similar model, based on the Java programmers do not need to learn anything new. The JSF UI components can be produced, for example, when the page of a text input box content has been modified, will be issued a "change of the incident." Another object if "value change events," interest only for the registration of the object interception, and the preparation of handling routines can be ordered at the time of the incident JSF automatic call processing routines. JSF to do all the things left to the programmer only the preparation of business logic code.
4. JSF advantage of the three: the user interface directly to the business logic of the map
For example, the form is the most common Web programming task, and is also one of the most complex tasks. When users click on the web site, "OK" button, the browser will generate an HTTP request, the server-side to a Servlet, and the implementation of the Servlet the service method. In the service method, the HTTP request requires decoding, type conversion, validation, the state of preservation, data updates, and links to handle all the details of these links, the programmer is a heavy burden. In JSF, these large part by the work of the framework of commitments, in the programmer, this process is transparent, and the user interface side of the HTTP request can be directly mapped to a back-end processing routines incident, the JSF has played a role in the unfinished .
5. JSF advantage four: programmers and Web designers in the division of JSP, programmers and Web design is the work of each other sometimes intertwined, indistinguishable. This is because the introduction of a JSP page by page designers not familiar with some of JSP tags, or even obscure Java code. Web designers requested that these labels and the code is unrealistic, inconsistent with the principle of division of labour. In JSF, web design framework provided a standard set of UI components, with the support of the tool can be adopted by a simple drag-and-drop to add to the homepage, and then set up some visual display attribute to meet demand. Web designers do not need to know UI components behind the complex code, which is what programmers, and programmers do not need to deal with any relevant details and visual, programmers did was bundled to the UI components of the attribute or Methods. Although programmers and Web designers need to revise the same document, but they perform their duties properly provided, Noninterference. Programmers and Web designers a clear division of work is in the ease-of-use JSF a big step forward.
6. JSF advantage five: request handling of the multi-stage life cycle of the Servlet Although there are established based on the life cycle of the JSF is much more complicated than JSP. JSP the life cycle is very simple, the implementation of the pages, HTML tag was generated, then the end of the life cycle. And a complete JSF requests - dealing with the life cycle was carefully planned for the six stages, the typical JSF request to go through all stages of certain special requests can also skip some stages. Phase of the subdivision, is the introduction of more treatment, but JSF framework to manage all this, so programmers get more control in the same time, the workload has not increased.
7. JSF advantage 6: With the survival tools
JSF has brought tremendous changes in the Web programming, a strong degree of change than many tools vendors expected, so now for the use of the JSF is the lack of tools. A lack of tools to support the JSF will敬而远之is, therefore, the beginning of the JSF design tool vendors to set aside a battlefield. In the few tools JSF, the sun Java Studio Creator is an excellent development environment; Borland's Jbuilder in JSF1.1 at once is a very useful development tools, now JSF1.2 Unfortunately, the support has not caught up; Eclipse JSF under a lot of plug-ins, but genuine support of the JSF WYSIWYG plug-ins are charges, for example, the Workshop for JSF Bea, the Exadel JSF Studio, etc. In addition, Oracle and IBM have JSF development tools. With the continuous emergence of tools, the development of Web applications using JSF will be more convenient and faster.
8. JSF advantage 7: comprehensive support for the user-defined
Mentioned earlier, the JSF will greatly simplify the development of Web applications, as a relatively complex framework, JSF is how to do that? The original programmer for the JSF to provide a lot of components and the default category, under normal circumstances, these JSF components and the default category sufficient to meet the needs for development of the Web. However, considering that in certain applications, the default behavior of the framework may not comply with the requirements, particularly JSF allow programmers to prepare their own components and category, to meet the special needs of customers. For example, programmers can write their own UI components, and can even create their own interpretation of the EL, to support non-standard language EL expression.
9. JSF advantage 8: Web development one of the official standards
JSF 1.0 release in February 2004, then as an independent Web technology introduced. After version 1.1 to 1.2 is the latest version of a short period of more than two years, finally JSF in the mid-2006 Java EE 5 as a component of the Web will rise to the development of the official criteria. Java EE 5 most important mission is to simplify the development of Java, and JSF undoubtedly made a contribution this mission. In the framework of an endless stream even some Web swamped today, Sun to JSF to establish standards, the development of Java is useful. Sun Java in the area of leadership status should not be shaken, for Java programmers, always follow the pace of the industry leaders, may avoid technology is the best way backward.
10. CONCLUSION:
That you, JSF! A study of the prevalence of technology, google keyword searches may be a simple method. In order to facilitate that we are now the most popular choice of Struts and JSF comparison. Google respectively in the import keyword "Struts" and "JSF" to see the return of google page number. We are not interested in the absolute number of pages, but the number of JSF and Struts web page volume ratio. We see that the English website, the ratio is 0.6, Japanese website is 1.0, Traditional Chinese website is 0.8, and only 0.4 Simplified Chinese website. Table 1 identifies the specific data and ratios.
ASH quantity (10,000) Japanese website quantity (10,000) Traditional page volume (million) Simplified page number (10000)
JSF Struts JSF Struts JSF Struts JSF Struts
719 1170 14514010 13 59 138
JSF / Struts = 0.6 JSF / Struts = 1.0 JSF / Struts = 0.8 JSF / Struts = 0.4
Although such a comparison methodology is not sufficiently rigorous, but from a 0.4 ratio in the domestic side of the JSF has not yet popular, and used the "upswing" JSF words to describe the situation, could not have been better. Due to historical reasons, the country's software technology has always been to follow the footsteps of foreign run, this is not what we want, but we have to admit that, therefore, the situation from abroad inference, we have reason to believe that the JSF will become the programmer pursuit target. As a certain philosopher said, the JSF eight in the morning, the sun 9:00 bell, pinning its hopes on the JSF.
11. Postscript: different voices
Objectively speaking, the JSF is not perfect, the industry's JSF evaluation also mixed. For example, the JSF is too complicated, the learning curve was longer than other frameworks such as Struts, and so on, which to some extent hindered the promotion of JSF; In addition, the introduction of JSF a little hasty, in the use of Version 1.0 found in many bug, so sun Release 1.1 Moderators hurry if these amendments to bug; Also, in JSF1.2 version before the integration of JSP and JSF has a serious defect, which was mainly due to the life cycle of two different result, however, in version 1.2 This has made improvements, now, JSP and JSF will be given a project of the troubles.
The inadequacy of the JSF there are many, such as the lack of rich UI components, concrete realization of the scope for reducing the size of the option, the use of the actual development of the JSF project little sun reference realize there are many bug, and the lack of short-term support tools, etc. , in particular in China, the Chinese JSF is the lack of documentation and books. But, in any case, these are on the road JSF growth must undergo the ordeal, I believe Sun will try our best.
</ Td> </ tr> <tr>
↑ Back






