With all the prep work behind us, we're ready to use our custom tag within a JSP page.
我们完成了所有这些准备工作后,我们就可以在JSP 页面中使用我们的自定义标记了。
All business logic should be in classes, and if you absolutely had to have code in your JSP page, you would wrap it up in a custom tag.
所有的商业逻辑都应该在类中,如果你确实需要在你的JSP页面中包含代码,你应该用自定义标签来包装它。
So the example usage of this custom tag passes validation.
因此这个自定义标记的示例用法通过了验证。
In that case, you want to design a custom tag that supports all these table types.
在这种情况下,就需要设计一个支持所有这些表格类型的自定义标记。
Listing 1 shows what the handler of the custom tag should look like.
清单1展示了定制标记的处理函数是什么样的。
For example, if you want to change the HTML produced by a JSF component, you normally have to recode the component's renderer and implement a new custom tag.
例如,如果想要更改JS f组件生成的HTML,通常情况下需要对组件的呈现程序进行重新编码,并实现一个新的定制标记。
The issue was caused by a custom tag engine, that kept large object lists in memory.
问题是由自定义标签引擎引起的,它会在内存中存放大型对象列表。
The JSP container evaluates each custom tag during the execution of a JSP page that references it.
在执行引用自定义标记的jsp页面时,jsp容器判断每一个自定义标记。
When the container encounters a tag, it invokes the tag handler class associated with the custom tag, which is a process we'll talk more about later.
当容器遇到一个标记时,它调用与这个自定义标记相关联的标记处理程序,我们将在后面更多地讨论这个过程。
JSP pages, however, with their mix of code and custom tag libraries, cannot function well in this environment.
然而,由于jsp页面将代码和自定义标记库相混合,因此无法在这种环境下良好地工作。
It finds what it needs to know about a custom tag by reading metadata about the tag.
它通过读取标记的元数据来确定需要知道自定义标记的哪些信息。
How does the JSP container know which attributes of a custom tag are required and which are not?
jsp容器如何知道自定义标记的哪些属性是必选的哪些是可选的?
The JSP custom tag libraries are a collection of actions presented as tags.
JSP定制标记库是用标记表示的一组行为的集合。
In addition, there is a standard facility that developers can use to define their own tags, which are organized into custom tag libraries.
另外,在自定义标签库中组织了一套标准的工具,开发者们可以使用这些工具来定义他们自己的标签。
In this installment of J2EE pathfinder, you've walked through the process of creating a custom tag from scratch and implementing it in a JSP page.
在J2EE探索者的这篇文章中,您经历了从头创建一个自定义标记并在jsp页面中实现它的过程。
In the next scenario, the hypothetical Web site ensures that the generated pages are properly encoded by using the XSS custom tag library and is able to protect itself from the attack.
在下一个方案中,这个虚拟网站确保生成的页面是通过使用xss定制标记库正确编码的,并且能避免攻击。
We have also demonstrated that the majority of the attacks can be eliminated when a Web site uses a simple custom tag library to properly encode the dynamic content.
我们还演示了当网站使用简单的定制标记库正确编码动态内容时,可以消除大多数攻击。
Your simple custom tag is coded and tested. Now you'll build a tag that's a wee bit more sophisticated.
编写并测试过简单的自定义标记之后,现在要构建一个略微复杂一些的标记。
It is similar to a custom tag you might find in JSPs, at least in terms of its syntax.
它与JS p中的定制标记相似,至少在语法方面是相似的。
Of further benefit is the existence of the standard set of custom tag libraries defined within the JSTL.
更好的是在JSTL中已存在一组已定义的标准的自定义标记库。
The use of a custom tag and associated tag library would allow the example above to be converted to that shown in Listing 6.
使用自定义标记和相关的标记库允许把以上示例转换为清单6所示的内容。
This API is used extensively when implementing JSP custom tag handlers.
这个API在实现JS p自定义标记处理程序时使用得非常多。
Using the example below, we earlier looked at how custom tag validation worked.
以下面的代码为例,这是我们在前面了解自定义标记验证如何工作时所涉及的内容。
The custom tag also has an optional params attribute, which can be a single object or an array of objects.
这个定制标记还有一个可选的 params属性,它可以是一个单一的对象或一个对象数组。
In this series, we have examined the capabilities of the four JSTL custom tag libraries and their usage.
在本系列中,我们讨论了4个JSTL定制标记库的功能及它们的使用。
The XSS custom tag library, which is part of a Web application, is packaged as additional files into the Web application's WAR file as follows.
xss定制标记库是Web应用程序的一部分,它作为附加文件打包到Web应用程序的WAR文件中,如下所示。
JSP tag files are the ideal solution for simplifying Web component development because they let you create custom tag libraries, using the JSP syntax.
JS p标记文件是简化We b组件开发的理想解决方案,因为它们允许使用jsp语法创建定制标记库。
Now let's consider a more complex example, where we use the ability of a custom tag to generate more than one bean definition.
现在让我们来考虑一个更加复杂的例子,其中我们要使用自定义标签的能力来产生不止一个bean定义。
In this article, you learned how to create a custom tag for table data display with different HTML controls, including href, checkbox, radio button, text field, and combo box.
在本文中,介绍了如何为带有不同html控件的表格数据显示创建自定义标记,包括href、选择框、单选按钮、文本框和组合框。
Perhaps as much as 80 percent of the custom tag functionality that you will need has already been created and standardized by the J2EE community.
您所需要的自定义标记功能中也许有多达百分之八十已经由J2EE团体创建并标准化了。
应用推荐