January 10th, 2008

file attribute is a relative URL. A few caveats concerning the use of the include directive are in order. First, be aware that the file to be included may (and usually does) contain JSP code. If the to-be-included file contains page directives, the restriction about the multiple occurrences of page directive attributes applies. In other words, you cannot have an included file contain a page directive with an attribute already coded in the JSP page (except the import attribute). Another caveat is that when you change an included file, you must update all the JSP files that include the changed file. What you need is a JSP or server command that tells the JSP translator to retranslate, but such a command is not currently available. The JSP translator detects when JSP pages require translation based on modification dates. An admittedly primitive but effective workaround is to change a comment in your pages that uses included files to force a retranslation. Later in this chapter, in the section titled Coding JSP Standard Actions, you ll read about the Here, the uri attribute provides an absolute uri containing the code that implements the custom tag s behaviors. The value of the uri attribute can be an absolute (shown above) or relative reference. The prefix attribute associates the custom tag coded in the JSP page with the library name coded as a value of the uri attribute. Note The term uri means Universal Resource Identifier. Think of a uri as a URL or a file reference. The following is an example of a custom tag from http://joestags.tld referenced by the value of the prefix attribute coded in the taglib directive:
Need a managed web hosting provider to help maintain your website? Our web hosting service is the preferred choice of thousands of demanding customers.

January 9th, 2008

January 8th, 2008

January 7th, 2008

January 6th, 2008

The default value of the autoFlush attribute is true. The contentType Attribute The contentType attribute sets the character encoding for the JSP page and for the generated response page. Put differently, the contentType attribute tells the browser how to render the generated page. You can code a mime type or a mime typeand charset. Some examples follow. The following statement directs the browser to render the generated page as HTML: The following statement directs the browser to render the generated page as plain text: Note Internet Explorer seems to ignore the contentType value of text/plain. If your JSP page contains HTML, Internet Explorer will render the page as HTML. The following directive sets the content type as a Microsoft Word document. Listing 4-1 is an example of a JSP page that specifies a contentType of Microsoft Word. Listing 4-1: JSP page specifying page content is a Microsoft Word document Showing the contentType Attribute

January 6th, 2008

January 5th, 2008

January 4th, 2008

January 3rd, 2008

January 2nd, 2008