9, compile the code and run the application. The final step is to compile the code and run the program. Enter http: // localhost: 8080 / hello in your browser, you get index.html, as shown below:
Figure 4: INDEX.HTML
10. Click "Here" super connection, you will get index.jsp:
Figure 5: Application startup
11, good, enter your name and submit, you will get:
Figure 6: Good application (click to enlarge)
Enter check
JavaServer Faces offers a set of standard embedded calibration mechanisms, and developers can also generate their customized checker (Validator) by implementing the Validator interface and overriding its validate method.
Let's introduce the five embedded Validator contained in the system:
Floating point score detector: Check if the value of the component is within a certain range, where this value must be a floating point number or can be converted to a floating point number. We can use this validator through the Validate_DoubleRange tag. Below is an example:
input_number>
Length Checker: Check if a string variable (the type of variable must be java.lang.string) is within a certain range. We can use this validator through the Validate_length tag. Below is an example:
input_text>
Long integer range Verifier: As long as a value can be converted to a LONG type, you can use the verifier to check if its value is within a certain range. We can use this validator through the Validate_longrange tag. Below is an example:
input_number>
Null Value Check: Check if a value is null, for a string variable (java.lang.string), check it is an empty string. We can use this validator through the Validate_Required tag. Below is an example:
input_text>
String range Verifier: Check if a string variable (java.lang.string) is within a certain sense. We can use this validator through the Validate_StringRange tag. Here is an example:
input_text>
to sum up
JavaServer Faces is a user interface framework for constructing a web application. It runs on the server side, which can express the user interface to the client, supporting its development tools to develop greatly develop Java-based web applications. Other members of the Sun and JavaServer Faces expert group, including Borland, IBM, Macromedia, Oracle, etc., and many other companies and individuals are trying to integrate JavaServer Faces into the next-generation development tool, which simplifies web-based multi-layer applications. Development.
Users of JavaServer Faces applications can enjoy a variety of benefits provided by JavaServer Faces, and relative to the front end of HTML, developers can also provide more features and user interfaces that are easier to use. But if you want to master JavaServer Faces, you may have to spend a little more effort - Of course, you will find that the benefits are big.
For if you want to know more, you can refer to the following address:
JavaServer Faces Technology JavaServer Faces Specification (JSR 127) Download the JavaServer Faces Reference Implementation JavaServer Faces Tutorial Struts-Faces (Integration Strategy for Struts and JavaServer Faces) JavaServer Faces Technology Forum (free registration required) JavaServer Faces FAQ
Finished>
For the rest: http://www.9cbs.net/develop/read_article.asp?id=18705 Develop web applications with JavaServer Faces (1)
Http://www.9cbs.net/develop/read_article.asp?id=18707 Develop web applications with JavaServer Faces (2)
Http://www.9cbs.net/develop/read_article.asp?id=18709 Develop web applications with JavaServer Faces (3)
Http://www.9cbs.net/develop/read_article.asp?id=18710 Develop web applications with JavaServer Faces (4)