Free web space - This tag calls the method using the name
This tag calls the method using the name attribute. The name attribute must start with a “/”. 8.6.7 The write Tag The write tag is another important tag within the Bean tag library, and it gets a great deal of use. It retrieves the value of the specified bean property and renders it to the page output as a String. The write tag uses the following rules: If the format attribute is specified, the value will be formatted based on the format string and the default locale. The formatKey attribute can also be used. It should specify the name of a format string from the message resource bundle. The formatKey attribute is used to specify a format string from the resource bundle. The specific resource bundle and locale can also be specified. If the bundle and locale are not specified, the default resource bundle and current user locale will be used. Otherwise, the usual toString( ) conversions will be applied. The following is an example of using the write tag:
If the attribute is set to trueand the bean specified by the name and attributes is not found, the tag will not throw an exception. If not set, or set to false, a runtime exception will be thrown. 8.7 Template Tags The concept of templates has not been discussed yet in this book. The Template library supplies tags that are useful for creating dynamic JSP templates for pages that share a common format. These tags provide capabilities similar to stylesheets or the standard include directive in JSP technology, but they can be dynamic. With the advent of the Tiles framework, which we’ll discuss in Chapter 14, the template tags become less widely used. Thus, I’ll provide a list of the tags within the library, but won’t go into detail about them. If you require more information on the tags within the Template tag library, you can find it in the Struts API at http://jakarta.apache.org/struts/api/. The tags within the Template library are listed in Table 8-10. Table 8-10. Custom tags within the Template tag library Tag name Description insert Retrieve (or include) the specified template file, and then insert the specified content into the template’s layout. By changing the layout defined in the template file, any other file that inserts the template will automatically use the new layout.
Note: In case you are looking for affordable and reliable webhost to host and run your j2ee application check Vision J2ee Web Hosting services.