JSF教程

歡迎來到JSF教程。Java Server Faces(JSF)技術是一種前端框架,通過重用UI組件,使用戶界面組件的創建變得更加容易。JSF基於模型視圖控制器模式(MVC)設計,將表示層、控制器和業務邏輯分開。

JSF教程

最近我寫了很多JSF教程,所以這個JSF教程是索引帖,您可以通過它按順序學習JSF框架的所有教程。這些JSF教程中大多數附帶可下載的項目zip,您可以使用它們並進行一些更改以通過示例進行學習。

  1. JSF 新手教程

    這是開始使用 JSF 框架的完美教程。您將獲得所有基本細節並創建您的第一個基於 Maven 的“Hello World”JSF項目。如果您已經具備JSF框架的基本知識,您可以跳過它。但是最好還是從初學者教程開始,然後再學習更多功能。

  2. JSF 初學者教程,帶有 Primefaces 實現

    Primefaces 是 JSF 規範中最受歡迎的實現之一,我們已經發表了很多關於 Primefaces 的帖子,但這個帖子也涵蓋了 JSF 架構。我認為你應該通過它來了解,我們也可以使用其他 JSF 實現來創建基於良好 UI 的項目。

  3. JSF 视图页面组件 – 标签、图像、按钮、文本字段

    这是一个适用于 JSF 视图页面的入门帖子,您将学会如何轻松地添加简单组件,如标签、图像、按钮等,并将它们与后端托管的 Bean 绑定。

  4. JSF資源包範例教程

    將UI標籤、日期、狀態消息和其他UI文本元素存儲在單獨的屬性文件中,而不是在頁面中將它們硬編碼的現象稱為資源捆綁。默認情況下,JSF根據上下文提供一些標準錯誤消息,例如字段類型或字段長度驗證。本教程將解釋如何在項目中使用資源包進行本地化,以及如何使用資源包文件為標準JSF錯誤消息提供自定義消息。

  5. JSF錯誤訊息教程

    在本文中,您將學習如何使用默認的JSF驗證器向用戶發送內建的錯誤訊息。您還將簡要瞥見使用JSF HTML標籤的情況。

  6. JSF頁面導航教程

    頁面導航是根據執行的事件(例如點擊按鈕或點擊連結)將頁面重新定向。有許多定義頁面導航的方法。這些方法包括「在提交按鈕的行動屬性中指定頁面名稱」、「在受控Bean中指定頁面」、「在faces-config.xml中指定導航」和「根據條件定義導航」,您將通過示例學習這些方法。

  7. JSF UI元件標籤示例教程

    JSF是一個基於組件的框架,其優勢在於組件標籤與托管 bean 輕鬆集成。本文介紹了 JSF HTML 標籤中使用的不同屬性,例如 id、for、value、style required、size 等。

  8. JSF 表單元件示例教程

    表單元件是一組字段,連同數據和提交功能,用於發送到實現業務場景的模型。由於大多數Web應用程序使用用戶提交的數據(如登錄、註冊、插入或更新數據庫中的值等),在JSF中廣泛使用表單元件。本帖子解釋了如何在JSF頁面中使用表單元件以及它們的不同屬性,並附有示例項目。

  9. JSF文本組件示例教程

    JSF文本組件允許用戶以Web應用程序的形式添加、查看和編輯數據。JSF文本組件包括標籤、文本字段、文本區域和密碼。本文將通過示例項目介紹這些標籤的使用方法。

  10. JSF命令元件標籤範例

JSF Command components are used for performing action and navigation in the JSF pages. This post explains about the h:commandButton and h:commandLink tags with example project.
  1. JSF dataTable 標籤範例教學

The data bound table components are responsible for displaying the relational data in a tabular format. The h:dataTable tag is used for displaying the data components. The h:column tag iterates over each record in the data source displayed in rows. This is a very important component tag and you should understand it's usage and working carefully through the example project in the post.
  1. JSF selectManyListBox標籤範例

JSF allows users to select multiple values for a single field with the help of h:selectManyListBox tag which corresponds to select tag in standard HTML. This post explains it's usage and different attributes of this tag with a working example.
  1. JSF Facelet標籤範例教程

JSF provides a special set of tags that gives the flexibility to manage common tags/parts in one place for more than one application. These tags allow us to create a common layout that can be used across applications. These are called facelets tags and this post explains about different facelets tags in detail with working example code.
  1. JSF事件監聽器模型範例

JSF Event and Listener model is based on the JavaBeans Specification. An event is defined as a signal triggered based upon the user actions such as click of button, hyperlink, changing the input value etc. JSF tells the component to invoke the appropriate listener class that process the event generated by the user. This article explains about different events with example projects.
  1. JSF 表單驗證範例

Form validations are common features in almost all web frameworks. JSF validation model defines a set of standard classes for validating the UI components. The JSF library defines a group of core tags that corresponds to `javax.faces.validator.Validator` implementations. Apart from the standard error messages validation model allows us to define the custom validations. Validations in JSF can be categorized into Imperative and Declarative.
  1. JSF導航規則教程

Navigation rules specifies the navigation between the pages on click of button or hyperlink. Navigation can be specified in terms of the logical outcome such as success, failure or through action method. Navigation rules can be specified in faces-config.xml with the help of navigation-rule tag.
  1. JSF行動方法導航示例

Navigations can also be handled in JSF by writing methods in the managed bean. These methods should be public, take no parameters and should returns an object or a view name. The method is invoked in the action attribute of the JSF page. You will learn about this way of navigation through example project in the post.
  1. JSF 表達式語言 (EL) 範例教程

JSF Expression Language enables users to access the data dynamically from the JavaBeans components using various expressions. The EL supports the following kinds of expressions - Immediate value expressions or Deferred value expressions, Value expression or method expression and rvalue or lvalue expressions. Check out this post to understand about these in detail with example code.
  1. JSF 會話管理、身份驗證、登入登出範例

Authentication mechanism allows users to have secure access to the application by validating the username and password. This tutorial shows you how to build session management with authentication in JSF application by using JSF view for login, DAO object, HttpSession for session management and JSF managed bean and mysql database.
  1. JSF 和 JDBC 整合示例教程

Java Server Faces can be connected to database to perform operations on the data using JDBC API. This is a simple post where you will learn how to use JDBC API in a JSF based web application.
  1. JSF 和 Spring 框架整合示例

JSF is a component based framework with great focus on user interfaces. Whereas Spring framework core principle is Dependency Injection. So it makes sense to integrate JSF with Spring framework where JSF will be used for user interfaces and Spring framework will be used for backend server side business logic. This is an important article where you will learn how to integrate both these great frameworks and using the best features of each one.
  1. JSF、Spring 和 Hibernate 整合範例教程

JSF, Spring Framework and Hibernate - these three frameworks can be used together to build stunning web application where JSF components provide stunning UI, Spring components provide loose coupling through dependency injection and Hibernate takes care of interaction with database.
  1. JSF 面試問題與答案

Finally if you are going to an interview and expecting JSF interview questions, then make sure you go through there. There are more than 50 questions with detailed answers that touch all the areas of JSF framework and help you in getting ready for the interview.

{
“error”: “Upstream error…”
}

Source:
https://www.digitalocean.com/community/tutorials/jsf-tutorial