Web programming Learning 1: using JSF to create Web Applications

Source: Internet
Author: User

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.


Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.