The language Attribute The language attribute indicates the programming language used in scripting the JSP page. The JSP specification requires that a JSP implementation support a value of java for the language attribute. However, other JSP implementations may, and do, support other values for the language attribute. The session Attribute The session attribute indicates whether or not the JSP page uses HTTP sessions. A value of true means that the JSP page has access to a builtin object called session; a value of false means that the JSP page cannot access the builtin session object. Put another way, the following directive allows the JSP page to use any of the builtin object session methods, such as session.getCreationTime() or session.getLastAccessTime(): <%@ page session="true" %> When the session attribute has a value of false, any attempt to access the builtin object session causes an error during JSP to servlet translation. In Chapter 5, JSP Web Sessions, sessions are covered in detail. You should recall that an advantage of using servlets over traditional CGI is that servlets allow for sessions that maintain information about the client across multiple Web pages whereas CGI does not. To wrap up the plethora of attributes for the page directive, I want to note again that these attributes do not direct any output to the eventually displayed page. You may code multiple page directives in your JSP page, but, with the exception of the importattribute, attributes can appear at most once in the page. In addition, you may code more than one attribute in a single page directive, with some combinations (such as buffer=”none” and autoFlush=”false”) not permitted. JSP has two other directives: the include and the taglib directives, which are covered in the following two sections. The include Directive You probably have an idea of the purpose of the include directive. The include directive enables you to bring external code into your JSP at the point of reference. The syntax is as follows: <%@ include file="relativeURL" %> Unlike page directives, the placement of the include directive is critical. The JSP translator copies the code stored at relativeURL into your JSP page starting at the location of the include directive. The URL specification in the value of the
Our facility is located in Orlando, Florida. Our Orlando web hosting data center gives you assurance that your website will work smoothly . Check more in Orlando Web Hosting.

Leave a Reply