我们完成了所有这些准备工作后,我们就可以在JSP页面中使用我们的自定义标记了。
With all the prep work behind us, we're ready to use our custom tag within a JSP page.
清单8.使用自定义标记的版权声明。
清单9.自定义标记的测试。
什么是自定义标记?
另外,您也可以定义自己的自定义标记。
自定义标记有丰富的功能。
自定义标记的优点包括。
因此这个自定义标记的示例用法通过了验证。
JSP体系结构需要以下组件以实现自定义标记。
The JSP architecture requires the following components to implement custom tags.
为表格显示定义自定义标记并使Web应用程序更容易管理。
Define a custom tag for table display and make your Web applications easier to manage.
更好的是在JSTL中已存在一组已定义的标准的自定义标记库。
Of further benefit is the existence of the standard set of custom tag libraries defined within the JSTL.
这样确保了我的自定义标记可以按照任意深度嵌套到gsp中。
This ensures that my custom tags can be nested to any arbitrary depth in the GSP.
jsp页面,描述了如何使用JSF自定义标记显示您的内容。
A JSP page that describes how to display your content by using JSF custom tags.
它通过读取标记的元数据来确定需要知道自定义标记的哪些信息。
It finds what it needs to know about a custom tag by reading metadata about the tag.
这个API在实现JS p自定义标记处理程序时使用得非常多。
This API is used extensively when implementing JSP custom tag handlers.
然后,将JSP声明加入到所有需要使用自定义标记库的页面中。
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?
在这种情况下,就需要设计一个支持所有这些表格类型的自定义标记。
In that case, you want to design a custom tag that supports all these table types.
下个月,我们将开始讲述JS p自定义标记和JSP标准标记库(JSTL)。
Next month, we'll start talking about JSP custom tags and the JSP Standard tag Library (JSTL).
使用自定义标记和相关的标记库允许把以上示例转换为清单6所示的内容。
The use of a custom tag and associated tag library would allow the example above to be converted to that shown in Listing 6.
在执行引用自定义标记的jsp页面时,jsp容器判断每一个自定义标记。
The JSP container evaluates each custom tag during the execution of a JSP page that references it.
编写并测试过简单的自定义标记之后,现在要构建一个略微复杂一些的标记。
Your simple custom tag is coded and tested. Now you'll build a tag that's a wee bit more sophisticated.
虽然标准Grails标记很有帮助,但是最终会遇到需要自定义标记的情况。
Although the standard Grails tags are quite helpful, you'll eventually run into a situation where you want your own custom tags.
任何人都可以编写JS p自定义标记,然后以标记库的形式将其提供给JSP创建者使用。
JSP custom tags can be written by anyone and then supplied for use by JSP authors, in the form of tag libraries.
我还简单介绍了JSTL并阐述了使用它而不是从头创建所有的自定义标记的好处。
I've also provided a brief intro to the JSTL and outlined the benefits of using it rather than creating all your custom tags from scratch.
以下面的代码为例,这是我们在前面了解自定义标记验证如何工作时所涉及的内容。
Using the example below, we earlier looked at how custom tag validation worked.
自定义标记的名称和属性是在js. tld文件中指定的(如清单19所示)。
The name and attributes of the custom tag are specified in the js.tld file (shown in Listing 19).
然而,由于jsp页面将代码和自定义标记库相混合,因此无法在这种环境下良好地工作。
JSP pages, however, with their mix of code and custom tag libraries, cannot function well in this environment.
允许用户通过自定义标记加水,种植面积,选择swf文件的特殊效应模型输出的视频。
Allow users to customize output videos through adding water mark, cropping the area, and choosing special effect models of the SWF file.
您所需要的自定义标记功能中也许有多达百分之八十已经由J2EE团体创建并标准化了。
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.
应用推荐