jsf教程
Welcome to JSF Tutorial. Java Server Faces (JSF) technology is a front end framework which makes the creation of user interface components easier by reusing the UI components. JSF is designed based on the Model View Controller pattern (MVC) which segregates the presentation, controller and the business logic.
欢迎使用JSF教程。 Java Server Faces(JSF)技术是一个前端框架,通过重用UI组件,可以更轻松地创建用户界面组件。 JSF是基于模型视图控制器模式(MVC)设计的,该模型将表示,控制器和业务逻辑分开。
Recently I have written a lot of JSF tutorial, so this JSF Tutorial is the index post where you can go through all the tutorials in order to learn JSF framework.
最近,我写了很多JSF教程,因此该JSF教程是索引文章,您可以在其中阅读所有教程以学习JSF框架。
Most of these JSF tutorials come with downloadable project zip that you can use and make some changes to learn by examples.
这些JSF教程大多数都带有可下载的项目zip,您可以使用它并进行一些更改以通过示例进行学习。
This is the perfect tutorial to start with JSF framework. You will get all the basic details and create your very first Maven based “Hello World” JSF project. If you have basic knowledge of JSF framework, you can skip it. However it’s always best way to start with the beginners tutorial and then learn more features.
这是从JSF框架开始的完美教程。 您将获得所有基本细节,并创建您的第一个基于Maven的“ Hello World” JSF项目。 如果您具有JSF框架的基本知识,则可以跳过它。 但是,这始终是从初学者教程开始然后学习更多功能的最佳方法。
Primefaces is one of the most popular implementation of JSF specifications, we have published a lot of posts on Primefaces but this one covers JSF architecture as well. I think you should go through it to understand that we can use other JSF implementations as well for creating good UI based projects.
Primefaces是最流行的JSF规范实现之一,我们在Primefaces上发表了很多文章,但其中也涵盖了JSF体系结构。 我认为您应该仔细阅读它,以了解我们也可以使用其他JSF实现来创建基于UI的良好项目。
This is a getting started post for JSF view pages, you will learn how to add simple components such as labels, images, buttons etc. and bind them with the backend managed bean easily.
这是JSF视图页面的入门文章,您将学习如何添加简单的组件(例如标签,图像,按钮等)并将它们轻松地与后端托管bean绑定。
The phenomenon of storing the UI labels, date, status messages and other UI textual elements in a separate properties file instead of hardcoding these in a page is called resource bundling.
By default JSF provides some standard error messages depending on the context like say field type or field length validations. This tutorial explains about using Resource Bundles in your projects for localization and how you can provide custom messages for the standard JSF error messages using resource bundle files.
将UI标签,日期,状态消息和其他UI文本元素存储在单独的属性文件中,而不是在页面中对其进行硬编码的现象称为资源捆绑。
默认情况下,JSF根据上下文提供一些标准错误消息,例如字段类型或字段长度验证。 本教程说明了如何在项目中使用资源包进行本地化,以及如何使用资源包文件为标准JSF错误消息提供自定义消息。
In this post you will learn how to use the default JSF validators to shoot out the built in error messages to the users. You will also get a brief glimpse of JSF HTML tags in use.
在本文中,您将学习如何使用默认的JSF验证器向用户发出内置的错误消息。 您还将简要了解正在使用的JSF HTML标记。
Page navigation is the redirection of a page based on the events performed for instance – on click of a button or on click of a link.
There are many ways of defining page navigation. These include “Specifying the page name in the action attribute of the submit button”, “Indicate the page in the managed bean”, “Specify the navigations in faces-config.xml” and “Define the navigations based on the conditions” and you will learn about these with examples.
页面导航是基于例如单击按钮或单击链接时执行的事件的页面重定向。
定义页面导航的方法有很多。 其中包括“在提交按钮的action属性中指定页面名称”,“在托管bean中指示页面”,“在faces-config.xml中指定导航”和“根据条件定义导航”,然后您将通过示例了解这些内容。
JSF is a component based framework, the power of JSF is the component tags that integrates with the managed beans easily. This post explains about the different attributes used in the JSF HTML tags such as id, for, value, style required, size etc.
JSF是基于组件的框架,JSF的功能是易于与托管bean集成的组件标签。 这篇文章解释了JSF HTML标记中使用的不同属性,例如id,for,值,所需样式,大小等。
Form component is a collection of fields along with the data and submit functionality to be sent to the model implementing the business scenario. Form components are used a lot in JSF because most of the web applications work with user submitted data, such as login, register, insert or update values in the database etc. This post explains how to use the form components in the JSF pages and their different attributes with example project.
表单组件是字段以及数据和提交功能的集合,这些字段将被发送到实现业务场景的模型。 表单组件在JSF中使用很多,因为大多数Web应用程序都使用用户提交的数据,例如登录,注册,在数据库中插入或更新值等。本文介绍了如何在JSF页面及其中使用表单组件示例项目具有不同的属性。
JSF Text components allows the user to add, view and edit data in a form of a web application. JSF text components include label, text field, text area and password. You will learn about the usage of these tags with example project in this post.
JSF Text组件允许用户以Web应用程序的形式添加,查看和编辑数据。 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.
JSF Command组件用于在JSF页面中执行操作和导航。 这篇文章介绍了示例项目中的h:commandButton和h:commandLink标记。
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.
数据绑定表组件负责以表格格式显示关系数据。 h:dataTable标记用于显示数据组件。 h:column标记遍历数据源中以行显示的每个记录。 这是一个非常重要的组件标签,您应该了解它的用法,并仔细阅读本文中的示例项目。
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.
JSF允许用户借助h:selectManyListBox标记为单个字段选择多个值,该标记对应于标准HTML中的select标记。 这篇文章通过一个有效的示例来说明其用法和该标签的不同属性。
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.
JSF提供了一组特殊的标记,这些标记提供了灵活性,可以在一个地方管理多个应用程序中的通用标记/部件。 这些标签使我们能够创建可在应用程序之间使用的通用布局。 这些称为facelets标签,本文通过工作示例代码详细说明了不同的facelets标签。
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.
JSF事件和侦听器模型基于JavaBeans规范。 事件定义为基于用户操作(例如单击按钮,超链接,更改输入值等)触发的信号。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.
表单验证是几乎所有Web框架中的常见功能。 JSF验证模型定义了一组用于验证UI组件的标准类。 JSF库定义了一组与javax.faces.validator.Validator
实现相对应的核心标记。 除了标准的错误消息验证模型,我们还可以定义自定义验证。 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.
导航规则指定单击按钮或超链接后页面之间的导航。 可以根据逻辑结果(例如成功,失败或通过操作方法)来指定导航。 可以在导航规则标签的帮助下,在faces-config.xml中指定导航规则。
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.
也可以通过在托管Bean中编写方法来在JSF中处理导航。 这些方法应该是公共的,不带任何参数,并且应该返回一个对象或视图名称。 在JSF页面的action属性中调用该方法。 您将在文章中的示例项目中了解这种导航方式。
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.
JSF表达式语言使用户可以使用各种表达式从JavaBeans组件动态访问数据。 EL支持以下类型的表达式-立即值表达式或递延值表达式,值表达式或方法表达式以及rvalue或lvalue表达式。 查看这篇文章,以示例代码详细了解这些内容。
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.
身份验证机制允许用户通过验证用户名和密码来安全访问应用程序。 本教程将向您展示如何通过使用JSF视图进行登录,使用DAO对象,使用HttpSession进行会话管理以及使用JSF管理的bean和mysql数据库在JSF应用程序中使用身份验证来构建会话管理。
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.
可以将Java Server Faces连接到数据库,以使用JDBC API对数据执行操作。 这是一篇简单的文章,您将在其中学习如何在基于JSF的Web应用程序中使用JDBC API。
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.
JSF是一个基于组件的框架,非常注重用户界面。 而Spring框架的核心原理是依赖注入。 因此,将JSF与Spring框架集成是有意义的,其中JSF将用于用户界面,而Spring框架将用于后端服务器端业务逻辑。
这是一篇重要的文章,您将在其中学习如何集成这两个出色的框架以及如何使用每个框架的最佳功能。
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.
JSF,Spring框架和Hibernate –这三个框架可以一起使用,以构建出色的Web应用程序,其中JSF组件提供了出色的UI,Spring组件通过依赖注入提供了松散的耦合,而Hibernate负责与数据库的交互。
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.
最后,如果您要去面试并且期待JSF面试问题,那么请确保您已通过。 有50多个问题以及详细的答案,这些问题涉及JSF框架的所有领域,并可以帮助您为面试做准备。
That’s all for the index post of JSF tutorial, I will be adding more to the list as and when I write more articles on JSF tutorials. If you think that I have missed some important feature of JSF, then please let me know through comments below and I will try to post on that and include that to the list here.
以上就是JSF教程的索引文章,当我在JSF教程上撰写更多文章时,我将在列表中添加更多内容。 如果您认为我错过了JSF的某些重要功能,请通过下面的评论让我知道,我将尝试在此发表文章并将其包括在此处。
翻译自: https://www.journaldev.com/7635/jsf-tutorial
jsf教程