With all the prep work behind us, we're ready to use our custom tag within a JSP page.
我们完成了所有这些准备工作后,我们就可以在JSP 页面中使用我们的自定义标记了。
Listing 9. Test for a custom tag.
清单9.自定义标记的测试。
什么是自定义标记?
Associating a custom tag with a component.
把定制标记与组件关联。
This task is perfect for a custom tag library.
这个任务最适合于定制标记库。
Listing 8. Copyright notice with a custom tag.
清单8.使用自定义标记的版权声明。
To extend RSS basically means to add a custom tag.
说拓展rss基本上就是说添加自定义的标签。
So the example usage of this custom tag passes validation.
因此这个自定义标记的示例用法通过了验证。
The TLD file for our XSS custom tag library, is shown in Listing 1.
清单1显示了我们的xss定制标记库的tld文件。
Listing 1 shows what the handler of the custom tag should look like.
清单1展示了定制标记的处理函数是什么样的。
Listing 16 contains the rpc.tag file, which implements the custom tag.
清单16包含rpc. tag文件,该文件实现定制标记。
Create a new partial template and a new custom tag to speed things along.
创建一个新的局部模板和一个新的定制标记,以加快进程。
The JSP custom tag libraries are a collection of actions presented as tags.
JSP定制标记库是用标记表示的一组行为的集合。
The following scenario illustrates how the custom tag library would be used.
以下方案说明了如何使用定制标记库。
Using custom tag libraries to construct the component tree in the view root.
使用自定义标签库在视图根中构造组件树。
Thus, if the component already exists the custom tag will not modify its state.
因此,如果组件已经存在,自定义标签将不会修改它的状态。
In that case, you want to design a custom tag that supports all these table types.
在这种情况下,就需要设计一个支持所有这些表格类型的自定义标记。
The custom tag has two methods that return the component type and the renderer type.
定制标记有两个方法,分别返回组件类型和渲染器类型。
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.
它通过读取标记的元数据来确定需要知道自定义标记的哪些信息。
Define a custom tag for table display and make your Web applications easier to manage.
为表格显示定义自定义标记并使Web应用程序更容易管理。
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容器如何知道自定义标记的哪些属性是必选的哪些是可选的?
Your simple custom tag is coded and tested. Now you'll build a tag that's a wee bit more sophisticated.
编写并测试过简单的自定义标记之后,现在要构建一个略微复杂一些的标记。
In this series, we have examined the capabilities of the four JSTL custom tag libraries and their usage.
在本系列中,我们讨论了4个JSTL定制标记库的功能及它们的使用。
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所示。
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所示。
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所示的内容。
应用推荐