Hello everyone
This is the first article I am in 9CBS, so I didn't dare to serve the name "XXX proficiency". I only understand this new technology for friends who don't know anything about JSF. I will continue to launch. New work, I hope everyone will support it.
To the point……
JavaServer Faces (later with referred to as JSF) is Sun's web framework (Framework), which is introduced this year (2003), is used to create a server-side user interface. It seems that it seems to be very deepest, in fact it doesn't matter to new technology, knowing that asp.net friends will find its shadow in JSF.
Frame concept
First let's know what is a framework, familiar friends can not listen to me, directly look at the following JSF structure. Let us review our web development history:
The earliest CGI program should be an antiques developed by web. It allows the user browser to interact with the server. This is indeed a progressive progress, but the CGI program has high complexity, as long as we can implement, we will have a long time. Therefore, there must be a simpler way to replace it, so ASP is born (have to admit Microsoft can always go in front) It is simple to make it quickly, soon SUN launched servlet (Sun CGI program solution) Because servlet is relatively weak, Sun has launched JavaServerPages (now still popular JSP, no need and JSF to mix), JSP and ASP common disadvantages are code and HTML mixing (logic and display mixing) leading to them It's hard to stand up, and it is difficult to debug. The introduction of MVC mode makes this situation to change, and JSP developers can choose Mode1 and MODE2 to develop, and can partially do business logic and display separation, but this is not perfect, still confuse.
The web framework is born in this background, the web framework (for example, the most popular struts) is mostly based on the MVC design model, which defines its own set of specifications, separate business logic, display and process control, the developer as long as According to its specification, a low-coupling degree, high-maintainable web program can be developed.
2. JSF structure
JSF consists of two sets of things, user interface components tag libraries (including interface components, event monitors, checkors, type converters, etc.). Developers can use existing these implementations to carry out basic development can also be expanded.
View: It consists of JSF's label library and user-defined label library, which can be highly reused, allowing interface developers to develop basic independently, just like developing HTML pages.
Model: It consists of a BEAN in accordance with the JavaBeans specification, which holds data on the interface component and some simple logic. When the user operates the data, the data in the bean is timely update, this process is very similar to the Swing component. .
Controller: The flow control of the entire program is handed over to a servlet, which is used to navigate the page through the configuration file, which can replace the original hardcod implementation.
3. The advantage of JSF
As a web framework, JSF has all the advantages of other frameworks: the MVC mode makes the function module each, facilitates development, easy maintenance and expansion, JSF support event processing, various values, providing development. In addition, the reference implementation of JSF is HTML, but it is not limited to HTML, which can also support a variety of markers such as WML, which makes it more suitable for future web programs.
4. JSF-related stuff
I was originally wanted to put an example, but I was not familiar with this editor. Therefore, I will introduce some JSF-related information to you. I hope I can help.
Since it is a new technology, there are very few Chinese information, and there are not many articles in English, and the main concentrated Sun's website:
l http://java.sun.com/j2ee/javaserverfaces/index.jsp This is the first page of JSF technology, most of the relevant information can be found here
l http://java.sun.com/j2ee/javaserFaces/docs/tutorial.html This is the official JSF technical guide from Sun, I want to get more must-read information, I am working hard, English good friends You can also translate it over for you to share.
l http://java.sun.com/webservices/downloads/webserviceSpack.html This is the JWSDP download page, the JWSDP (Java Web Services Developer Pack) is a package that is used to develop a web service, JWSDP is integrated. The current version is 1.3, the JSF version is 1.1, you can download this development package, where the JSF of which tested is very worth learning.
5. Summary
As far as I personally seems that JSF is a very promising future technology. Since Sun launched the framework, it is likely to be a Web development standard in the future, so it is worth learning :)