There has been no coding for a long time. I am going to review it recently. Now I am going to start again and learn some useful technologies from building the environment to development.
The first example is to use JSF to create a simple Web application.
The environment I prepared is the Eclipse Juno Java EE version, and the Web server is Tomcat 7.0.
1. Create a Dynamic Web project of jface1. Then install the JSF 2.1 library.
2. Create a Page Template basictemplate.xhtml and add header.xhtmland footer.xhtml.
BasicTemplate.xhtml
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
3.create logon.xhtml
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
4.create welcome.xhtml
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
5. Create navigation between pages.
Done.
Click the Login button:
Summary:
A HelloWorld JSF application, you can see that the new Facelet page template is very convenient, and the page navigation function is also very interesting.