In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-25 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/02 Report--
JSF technology and components of what is, many novices are not very clear about this, in order to help you solve this problem, the following editor will explain in detail for you, people with this need can come to learn, I hope you can gain something.
JSF is a Web application framework standard developed by Java Community Process (JCP). JSF has a well-defined request processing life cycle and a rich component hierarchy, which aims to promote the simplicity of Java-based Web user interface development. Using the reusable, extensible, component-based user interface framework provided by JSF and with the support of the rapid development tool RAD, the Web user interface can be visually edited by dragging and dropping components, binding the components on the user interface to a data source, and handing the events generated by the client user interface to the server, thus greatly reducing the difficulty of developing Web user interface based on Java. Improve the efficiency of development.
One of the main advantages of JSF is that it is both a Java Web user interface standard and a framework that strictly follows the Model-View-Controller (MVC) design pattern. The clear separation of user interface code (view) from application data and logic (model) makes JSF applications easier to manage. In order to prepare the page to provide JSF context for application data access and to prevent unauthorized or incorrect access to the page, all user interactions with the application are handled by a front-end "Faces" servlet. JSF technology achieves the complete separation of application logic and presentation, and is a truly thorough MVC pattern.
JSF is a new standard Java framework for building Web applications. Web applications can be written manually according to the framework standards of JSF, and the design of Web user interface can be realized by text, just like writing HTML or JSP programs. At the same time, the system running platform needs to be built before development, operation and debugging.
The disadvantage of this is that it does not fully reflect the convenience and efficiency of visual development, which is generally used when analyzing the structure of Web applications.
(1) View design
The convenient and rapid development of JSF-based Web applications is realized under the condition that JSF provides a set of rich and reusable server-side user interface components. With the support of development tools, users can easily use these components to build a Web user interface in a visual environment, and deal with the user interface management problems such as data verification and event handling of the components.
Design each required JSP page, place the built-in components of JSF on the page, and bind the components to the JavaBean of the application layer. Using RAD tools, you can easily implement page files by dragging and dropping components without having to write a lot of code by hand. The development tool automatically generates the java file corresponding to the page, in which the JSF component of the page and its getter, setter method and the method corresponding to the "action" attribute of the JSF component are defined. Programmers can easily modify and debug on the basis of existing programs.
(2) Model design.
JSF technology achieves the complete separation of application logic and presentation. In the part of model design, programmers only need to consider the logical function of the program, not the representation of the data. The JSF model is implemented through the JavaBean program.
The JSF model is designed and implemented according to the business logic that the components in the page need to deal with. Using JavaBean in JSF can be declared directly in the JSF page or in the configuration file faces-config. Declared in xml.
If the application is deployed manually, the compiled JavaBean files should be placed in the WEB- INF\ classes directory of the Web application (under the TOMCAT environment); with the help of RAD development tools, the designer does not need to consider the deployment details, the development tool will automatically implement the business logic of the JavaBean files (uncompiled java files and compiled jar packages) successfully deployed in the relevant location.
(3) Controller design
The controller design of JSF is completed in the configuration file, and there are mainly two related files: web.xml file and faces- config.xml file (both in the WEB-INF directory). Web.xml files are mainly used to control the life cycle of JSF and implement deployment descriptors. The faces- config.xml file implements navigation and controls the jump process between pages in the file.
The configuration step is to first configure the web.xml file for the Web application, and then configure the control file faces-config.xml file for JSF. The format of the two files is fixed, and in the IDE environment, this process is done automatically by the tool without the intervention of the designer, and even the manual configuration is relatively simple.
JSF technology focuses on the View part, which implements the complete separation of Web application design roles. JSF web designers only need to focus on page design; application developers are mainly concerned with the development of JavaBean in the Model part; and the flow control of the program is specially configured by faces-config.xml.
Summary
JSF is a reusable, extensible, component-based and tool-friendly server-side UI framework in the field of Java-based UI application development. In RAD development tools that support JSF, people can do things like using Visual Studio. NET can also construct Web user interface conveniently and quickly, which greatly reduces the difficulty of using Java technology to realize Web user interface and improves the development efficiency.
JSF has a powerful component architecture and event handling system, which fully implements the application architecture of MVC mode, which greatly reduces the difficulty of developing Web user interface programs based on Java, improves the development efficiency, and is very suitable for the development of Web pages.
JSF is an open standard with good extensibility. According to the JSF specification, users can customize their own user interface components, event handlers, data checksum and transformation components according to their requirements, which are as reusable as standard JSF components. JSF API is built directly on top of Servlet API, so the rendering of JSF user interface components is not limited to specific scripting technologies or markup languages. The presentation layer can adopt technologies other than JSP.
Among many J2EE presentation layer framework technologies, JSF shows its exuberant vitality. Although there are still many problems in JSF technology, with the continuous maturity and version update of JSF technology, it will get more and more applications.
JSF framework building (MyEclipse) (to enable user login)
1. Create a new web project, select the Java EE 5.0option, enter the project name: JSFLoginDemo (example), and click finish.
two。 Select MyEclipse,Project Capabilities--- > Add JSF Capabilities from the menu and click finish.
Create a new resource file under 3.src, name it Messages.properties (for display internationalization), and write
Login_label=Please Login:
Login_label=User name:
Create a package under 4.src, which is called com.jsfdemo
5. Add managed Bean (New Managed Bean), name UserBean,Class:com.jsfdemo.UserBean,Scope:session, add userName,Property Kind:Simple,Class:java.lang.String, done. Then add password,Property Kind:Simple,Class:java.lang.String, and finish. Check the configuration information by ticking the following two items-> Next---- > finish.
Is it helpful for you to read the above content? If you want to know more about the relevant knowledge or read more related articles, please follow the industry information channel, thank you for your support.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.