Give the new definition a name (for example, tomahawk).
给新定义起一个名字(例如,tomahawk)。
Listing 20. Additional entries to the web.xml file for use with Facelets and tomahawk.
清单20.web . xml文件的其他条目,用于Facelets和tomahawk。
Using the Enterprise Explorer, look in the test project under the path /Web Content/WEB-INF/lib to find the tomahawk JAR file.
使用EnterpriseExplorer,查看路径/WebContent/WEB-INF/lib之下的测试项目,以找到tomahawkJAR文件。
For this tomahawk example, you picked only the tomahawk JAR file in the wizard, and added the other Apache Commons JAR files to the configuration later.
对于这个tomahawk范例,您在向导中只需选择tomahawkJAR文件,并将其他的ApacheCommons JAR文件添加至配置中。
The tag library used for the MyFaces Tomahawk components with Facelets is called tomahawk.taglib.xml, which contains the mappings for the additional Tomahawk components.
用于MyFacesTomahawk组件且带有 Facelets的标记库是tomahawk.taglib.xml,它包含了其他 Tomahawk 组件的映射。
This makes future updates much easier because when tomahawk-1.1.9.jar (for instance) is released in the future, you can update the library definition and keep the same file name.
这就使得以后的升级变得更加容易,因为将来您在发布 tomahawk-1.1.9.jar (举个例子)时,您就可以升级库定义并保持相同的文件名了。
Name the library Tomahawk, as shown in Figure 4.
将库命名为 Tomahawk,如图 4 所示。
Now open the library definition editor for the Tomahawk library.
现在为tomahawk库打开库定义编辑器。
Now you will configure visualizations for some of the Tomahawk controls.
现在您就可以为您的Tomahawk控件去配置可视化了。
In the Palette view, ensure that the Tomahawk drawer is expanded and open.
在Palette视图中,确保Tomahawkdrawer展开并打开了。
Now only your Tomahawk template will appear in the list, as shown in Figure 10.
现在列表之中将会只显示Tomahawk模板了,如图10所示。
The application USES a few of the Tomahawk validators and a custom validator class.
应用程序使用了一些Tomahawk验证器及一个定制validator类。
Next, create a library definition for the Tomahawk library and examine its elements.
接下来,为tomahawk库创建一个库定义,并检查它的元素。
Finally, it renders a Tomahawk calendar component if it is a date (see "About Tomahawk").
最后,如果是日期(参见“关于Tomahawk”),则呈现Tomahawk日历组件。
In the following example, you make it easier to add new columns to a Tomahawk data table.
在接下来的例子中,向Tomahawk数据表添加新列,会变得更加容易。
Open the Tomahawk library definition and go to the Drop Properties section for the column tag.
打开tomahawk库定义并转至column标签的DropProperties部分。
Let's step through the application a little further before exploring more of the Tomahawk components.
在探索更多Tomahawk组件之前,我们更深入地研究一下应用程序。
Some components in the Tomahawk library also require a filter to handle resource requests at runtime.
tomahawk库中的一些组件同样需要一个过滤器,以处理运行时的资源请求。
The Tomahawk message component must be associated to another component for which it reports the error.
Tomahawkmessage组件必须与另一个组件相关联,以便报告错误。
Then you will create data templates based on some sample data and generate Tomahawk controls bound to that data.
然后您要基于一些范例数据来创建数据模板,并生成与数据相绑定的Tomahawk控件。
MyFaces provides all of the classes required by the spec, as well as some additional JSF components called Tomahawk.
MyFaces提供了规范所要求的全部类,以及被称为 Tomahawk的其他JSF组件。
The use of Apache MyFaces Tomahawk validators and components were demonstrated along with the visual output to the browser.
本文演示了ApacheMyFacesTomahawk验证器和组件的用法以及浏览器的可视化输出。
Click OK to allow the tool to add Tomahawk into the test project (notice that the button tag was also added into the page).
点击OK以允许工具添加tomahawk到测试项目中(注意按钮标签也会添加至页面)。
You might also want to download the example code for this article and install Facelets (and Tomahawk) before going further.
在进一步深入学习之前,您也可能想下载本文的示例代码,并安装Facelets(和Tomahawk)。
You will now explore other modifications to the Tomahawk library definition that affect the tool behavior on a tag-by-tag basis.
现在探讨对tomahawk库定义所做的其他更改,该库定义会影响到标签基础上的工具行为。
The next line shows the use of the Tomahawk validateRegExpr validator and the regular expression pattern used to enforce the validation.
下一行代码展示了TomahawkvalidateRegExpr 验证器和用于加强验证的正则表达式模式的用法。
Find the Tomahawk command button tag in the library definition editor and open the tag Attributes section to see the list of attribute names.
在库定义编辑器中找到Tomahawk命令按钮标签,并打开TagAttributes部分以查看属性名的列表。
Merely by having this library definition and its containing project in your workspace, you've already succeeded in making the tools aware of Tomahawk components.
仅仅拥有这些库定义和它包含的项目,您已经成功地让工具意识到了Tomahawk组件。
For example, some of the Tomahawk components require additional Apache Commons code to work correctly, so you will add these additional resources into the configuration.
例如,Tomahawk组件需要更多的ApacheCommons代码来正常工作,所以您就需要向配置添加更多的资源。
And you examined a few of the many capabilities of Facelets, such as templating and error handling, and how to configure a Tomahawk-based JSF application to use Facelets.
还研究了一些Facelets功能,例如模板化和错误处理,以及如何配置基于Tomahawk的JSF应用程序,以便使用Facelets。
应用推荐