Sticking to the lifecycle frees you up to think about the details of validation and conversion, rather than the phases of the request process itself.
遵守生命周期的规定,可以让您更自由地考虑有关验证和转换的问题,而不是请求处理本身的阶段。
Additionally, while we discussed the most common conversion and validation techniques, there are some we couldn't include here.
此外,虽然我们讨论了大多数常用的转换和验证技术,但还有一些没有包含在内。
We'll explain in a minute why conversion and validation happen at these phases, but first let's clear up a more basic question: What is conversion?
我们将在稍后介绍为什么转换和验证会在这些阶段出现,但是首先让我们澄清一个更基本的问题:转换是什么?
The example application will cover most conversion and validation use cases, albeit at a basic level.
示例应用程序将涵盖大多数转换和验证用例,虽然只是初级的。
Figure 4 shows how the application deals with validation and data conversion errors.
图4展示了应用程序是如何处理验证和数据转换错误的。
For now, you should simply note that conversion and validation processes occur at the phases of apply request values, process validations, and render response.
现在,只需要注意转换和验证过程发生在应用请求值、处理验证和呈现响应阶段即可。
The main purpose of conversion and validation is to ensure values have been properly sanitized before updating model data.
转换和验证的主要目的是确保在更新模型数据之前已经经过了正确的无害处理。
Ultimately, the conversion and validation strategy you choose is up to you.
最终,要由您来确定选择何种转换和验证策略。
We'll start with an introduction to conversion and validation procedures as they apply to the JSF lifecycle, then demonstrate a default conversion and validation procedure in a simple JSF application.
首先我们将介绍应用于JSF生命周期的转换和验证过程,然后展示一个简单的JSF应用程序中的默认转换和验证过程。
As you saw in Figure 1, conversion occurs in the apply request values phase and validation in the process validations phase.
正如图1所示,转换发生在应用请求值阶段,而验证发生在处理验证阶段。
Something else to keep in mind is that conversion and validation don't necessarily work well together.
其他要牢记的是转换和验证不一定会很好地协同工作。
Then, we'll show you how to utilize JSF conversion and validation to ensure that the collected data is appropriate for the model.
然后,我们将展示如何利用jsf转换和验证确保收集的数据对于模型是适合的。
In this article, we'll work through the concepts of JSF's conversion and validation framework, which is much simpler to use and far more flexible than you may think.
在本文中,我们将介绍jsf转换和验证框架的概念,它比您所想的要容易使用得多,也灵活得多。
See Resources to learn more about creating custom conversion and validation messages in JSF.
关于在JSF 中创建自定义转换和验证消息的更多内容请参前阅参考资料。
Part 3 will pick up where I've left off, incorporating advanced features like conversion and validation.
第3部分将继续本文的介绍,内容涉及一些高级特性,例如类型转换和有效性验证。
We've covered quite a bit of ground in this article when it comes to JSF conversion and validation.
在本文中我们讨论了相当多的JSF转换和验证的基本内容。
The connection will be configurable: type conversion and validation operations may be applied before updating a property.
属性的连接是可配置的:在更新属性之前,可以进行类型转换和值校验操作。
Conversion and validation allow you to focus on business logic rather than the tedious qualifications of input data such as null checks, length qualifiers, range boundaries, etc.
转换和验证使您可以侧重于业务逻辑,而不是侧重于对输入数据进行繁琐的资格认定,比如null检验、长度限定、范围边界,等等。
For example, in Figure 5, Data Format Conversion is a task with the responsibility of converting purchase order messages to validation service messages.
比如,在图5中,DataFormatConversion是一项任务,负责将订购单消息转换为验证服务消息。
If the immediate property is false, the conversion and validation are performed during the following phase of the JSF request processing life cycle.
如果immediate属性为false,那么这个转换和验证就会在JSF请求处理生命周期的下一阶段执行。
Note that the conversion and validation processes outlined in Figure 2 represent the application flow when the UIInput component's immediate attribute is set to false.
注意,图2中描绘的转换和验证过程表示了将UIInput组件的immediate属性设置为false时的应用程序流程。
It makes sense, then, that conversion and validation processes happen before component data is bound to your backing bean model in the update model data lifecycle phase.
因此,在更新模型数据生命周期阶段中,在组件数据被绑定到backingbean模型之前进行转换和验证处理是有道理的。
The method uses NumberFormat.parse(String) for validation and conversion.
该方法使用NumberFormat.parse(String)来验证和转换。
Figure 3 shows where conversion and validation would occur in the JSF application lifecycle were the immediate attribute set to true.
图3展示了当immediate属性设置为true时,在JSF应用程序生命周期中的哪些地方进行转换和验证。
Were the attribute set to true, conversion and validation would occur earlier in the lifecycle, during the apply request values phase (see Figure 3).
如果这个属性设置为true,那么转换和验证会发生在生命周期更早的时期,即应用请求值阶段(参见图3)。
The last step of the decode method is to store the submitted value in the component (later it will be converted then validated; see Resources for more on validation and conversion).
decode方法的最后一步是把提交的值保存到组件(稍后会转换并验证它,请参阅参考资料获取更多关于验证和转换的内容)。
If the value conversion fails, an error message is generated and queued in the FacesContext, where it will be displayed during the render response phase, along with any validation errors.
如果值的转换失败了,那么就会生成一个错误消息,并在FacesContext中进行排队,在产生响应的阶段会显示其中的消息,同时还会显示所有的验证错误。
The error message locations are to display validation or data-conversion error messages for the text fields. There are three JSP pages: index.jsp.
错误消息位置用于显示针对文本字段的验证或数据转换错误消息。
The error message locations are to display validation or data-conversion error messages for the text fields.
错误消息位置用于显示针对文本字段的验证或数据转换错误消息。
The error message locations are to display validation or data-conversion error messages for the text fields.
错误消息位置用于显示针对文本字段的验证或数据转换错误消息。
应用推荐