With all the prep work behind us, we're ready to use our custom tag within a JSP page.
我们完成了所有这些准备工作后,我们就可以在JSP 页面中使用我们的自定义标记了。
So the example usage of this custom tag passes validation.
因此这个自定义标记的示例用法通过了验证。
Listing 1 shows what the handler of the custom tag should look like.
清单1展示了定制标记的处理函数是什么样的。
This API is used extensively when implementing JSP custom tag handlers.
这个API在实现JS p自定义标记处理程序时使用得非常多。
The JSP custom tag libraries are a collection of actions presented as tags.
JSP定制标记库是用标记表示的一组行为的集合。
Listing 16 contains the rpc.tag file, which implements the custom tag.
清单16包含rpc. tag文件,该文件实现定制标记。
Using the example below, we earlier looked at how custom tag validation worked.
以下面的代码为例,这是我们在前面了解自定义标记验证如何工作时所涉及的内容。
In that case, you want to design a custom tag that supports all these table types.
在这种情况下,就需要设计一个支持所有这些表格类型的自定义标记。
The issue was caused by a custom tag engine, that kept large object lists in memory.
问题是由自定义标签引擎引起的,它会在内存中存放大型对象列表。
It finds what it needs to know about a custom tag by reading metadata about the tag.
它通过读取标记的元数据来确定需要知道自定义标记的哪些信息。
It is similar to a custom tag you might find in JSPs, at least in terms of its syntax.
它与JS p中的定制标记相似,至少在语法方面是相似的。
Next, we add a JSP declaration to any page that will need to use the custom tag library.
然后,将JSP声明加入到所有需要使用自定义标记库的页面中。
How does the JSP container know which attributes of a custom tag are required and which are not?
jsp容器如何知道自定义标记的哪些属性是必选的哪些是可选的?
The name and attributes of the custom tag are specified in the js.tld file (shown in Listing 19).
自定义标记的名称和属性是在js. tld文件中指定的(如清单19所示)。
The JSP container evaluates each custom tag during the execution of a JSP page that references it.
在执行引用自定义标记的jsp页面时,jsp容器判断每一个自定义标记。
Your simple custom tag is coded and tested. Now you'll build a tag that's a wee bit more sophisticated.
编写并测试过简单的自定义标记之后,现在要构建一个略微复杂一些的标记。
Of further benefit is the existence of the standard set of custom tag libraries defined within the JSTL.
更好的是在JSTL中已存在一组已定义的标准的自定义标记库。
In this series, we have examined the capabilities of the four JSTL custom tag libraries and their usage.
在本系列中,我们讨论了4个JSTL定制标记库的功能及它们的使用。
In the "Insert Custom Tag" dialog, under Tag libraries in document, select /WEB-INF/struts-bean.tld .
在“InsertCustom Tag”对话框中,在文档中的 Tag库中选择 /WEB-INF/struts-bean.tld。
The custom tag also has an optional params attribute, which can be a single object or an array of objects.
这个定制标记还有一个可选的 params属性,它可以是一个单一的对象或一个对象数组。
JSP pages, however, with their mix of code and custom tag libraries, cannot function well in this environment.
然而,由于jsp页面将代码和自定义标记库相混合,因此无法在这种环境下良好地工作。
As with the Label component, you will need a custom tag to bind the Field component to a JSP, as shown in Listing 7.
像使用Label组件时一样,需要用定制标记把Field组件绑定到JSP,如清单7所示。
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所示的内容。
Now all you have to do is create a TLD (tag Library Descriptor) file to register your custom tag, as shown in Listing 4.
现在要做的全部工作就是创建一个TLD(标记库描述符)文件,以登记定制标记,如清单4所示。
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定义。
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页面中包含代码,你应该用自定义标签来包装它。
In addition, there is a standard facility that developers can use to define their own tags, which are organized into custom tag libraries.
另外,在自定义标签库中组织了一套标准的工具,开发者们可以使用这些工具来定义他们自己的标签。
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文件中,如下所示。
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团体创建并标准化了。
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页面中实现它的过程。
应用推荐