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

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.

January 8th, 2008

Different servers may import additional classes, but the preceding list of classes is required to have a functioning JSP environment. You should not rely on your JSP pages having access to classes other than the ones listed without importing the classes yourself! Wouldn t you be embarrassed if your carefully coded JSP pages executed perfectly on server A but choked big time when the company switched to server B, a different Java-enabled server? The following example allows you to code unqualified references in a JSP page for classes in somePackage: <%@ page import="somePackage.*" %> The import attribute is the only attribute that may be coded multiple times in a JSP. Be advised that different Web servers use different directory structures. Therefore, in all likelihood, server A may force you to store your custom classes in a different directory than server B. Some servers require that you store classes used by your JSP pages in a different directory than the directory used to store custom classes for your servlets. The moral of the story is that a cursory glance at the server documentation is worth an hour of directory code examination and trial and error. The info Attribute The info attribute enables you to make a string available to your JSP pages by invoking the JSP page implementation of the Servlet.getServletInfo() method. The string can be pretty much anything you desire. The following is a coding example: <%@ page info="This JSP Page Written By Lou Marco" %> The isThreadSafe Attribute The isThreadSafe attribute lets the JSP container know how to dispatch requests to the page. The value of this attribute is a boolean. When the value is false, the JSP container dispatches one request at a time; when the value is true, the JSP container dispatches all outstanding requests simultaneously. Servlets usually create a thread per user request. Multiple requests result in the servlet dispatching multiple threads, each thread accessing the service() method of the same servlet. The underlying assumption is that the servlet is thread safe. The servlet synchronizes access to data so that threads do not “step on” each other. Assigning a value of true to isThreadSafe does not make your code thread safe. The isThreadSafe attribute is merely a statement about your code s ability to handle multiple threads. Although you should write your code to assume correct execution in a multithreaded environment, you may encounter a situation in which a class you need to use is not thread safe. Hence, you may, at times, code a value of false for the isThreadSave attribute. The default value is true.
Try discount web hosting services, our team’s aim is to offer the best possible web hosting services, at the lowest possible price.

January 7th, 2008

to the error page. Since JSP error pages are meant to inform on uncaught exceptions, you ll use error pages to report on such exceptions rather than attempt recovery. The JSP page MyErrorPage.jsp must have a page directive with the isErrorPage attribute set to true. The isErrorPage Attribute The isErrorPage attribute indicates whether or not the JSP page is the URL coded in another JSP page s errorPageattribute. The value of isErrorPage is either true or false. The default value of the isErrorPage attribute is false. The extends Attribute The extends attribute specifies a superclass that the generated servlet must extend. For example, the following directive directs the JSP translator to generate the servlet such that the servlet extends somePackage.SomeClass: <%@ page extends="somePackage.SomeClass" %> Do you see a potential problem with coding a value for the extends attribute? The server may be using a superclass already, or may require that generated servlets extend another, different superclass than the superclass coded as a value for the extends attribute. If you use the extends attribute, be careful. The import Attribute The import attribute serves the same function as, and behaves like, the Java import statement. Classes coded as values for the import attribute are made known to the generated servlet. If you do not code any page directives with import attributes, the generated servlet imports, at a minimum, the following classes: l java.lang.* l javax.servlet.* l javax.servlet.jsp.* l javax.servlet.http.*
Get account with us and you will get completely access to our free web templates database with over 10.000 templates in it to build your website.Don’t wait, go and check free web templates.

January 6th, 2008

Figure 4-1: Internet Explorer asks you what to do with this MIME type. Were you to open the file from its present location, Internet Explorer would display the file as a Word document. Were you to save the file, Windows would save the file as a Word document. Netscape would behave in a similar fashion. You can set a character set for encoding as the following example illustrates: <%@ page contentType="TYPE=text/plain;CHARSET=ISO-8859-1" %> Set the type to plain text using the character set ISO-8859-1. The errorPage Attribute The errorPage attribute defines another JSP page as one that handles unchecked runtime exceptions. The value of the errorPage attribute is a relative URL. Note Relative URLs, when coded with /as the first character (called a context-relative path), are referenced from the application; when coded without / as the first character, they are referenced from the JSP page. You cannot code an absolute URL reference in JSP pages. For example, the following directive displays MyErrorPage.jsp when all uncaught exceptions are thrown: <%@ page errorPage="MyErrorPage.jsp" %> MyErrorPage.jsp is stored in the same directory as the page containing the above page directive. If you code the directive as follows: <%@ page errorPage="/MyErrorPage.jsp" %> then MyErrorPage is stored in the root directory of the application. You can use the setAttribute() method of class javax.servlet.jsp.ServletException to pass the exception object
We feature a web hosting shopping cart and live support solution. Just try our web hosting shopping cartwhich provides a secure way of obtaining payments through your website.

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

Here’s some Bolded Text followed by some Italicized Text.

Here’s some more text Displaying this page in Internet Explorer gives rise to the File Download prompt, shown in Figure 4-1.
If you need complete web hosting solution you come to right place,try mac web hosting services.

January 5th, 2008

The buffer Attribute The buffer attribute specifies buffering characteristics for the server output response object. You d want a buffer for efficiency because buffered output is usually quicker than unbuffered output. Writing to the browser requires resources. The server sends buffered output in large blocks a few times, which requires less resources than sending unbuffered output in small blocks more often. You may code a value of “none” to specify no buffering so that all servlet output is immediately directed to the response object. You may code a maximum buffer size in kilobytes, which directs the servlet to write to the buffer before writing to the response object. Here are a few coding examples: To direct the servlet to write output directly to the response output object, use the following: <%@ page buffer="none" %> Use the following to direct the servlet to write output to a buffer of size not less than 8 kilobytes: <%@ page buffer="8kb" %> The exact size depends on the server. The behavior of the buffer when full is indicated by the value of the autoFlush attribute, which is described in the next section. The default value of the buffer attribute depends on the server implementation. The autoFlush Attribute The autoFlush attribute controls the behavior of the buffer or, more specifically, what happens to the output buffer when the JSP is buffered and the buffer is full (see the buffer attribute above). The autoFlush attribute takes a Boolean as a value. Some examples accompanied by a brief description of the directive follow. The following directive causes the servlet to throw an exception when the servlet s output buffer is full: <%@ page autoFlush="false"> This directive causes the servlet to flush the output buffer when full: <%@ page autoFlush="true"> Usually, the buffer and autoFlush attributes are coded on a single page directive as follows: <%@ page buffer="16kb" autoflush="true" %> The preceding directive establishes an output buffer not greater than 16 kilobytes that is flushed automatically when full. This directive generates an error. It doesn t make sense to code the autoFlush attribute without a buffer: <%@ page buffer="none" autoflush="false" %>
Do you want truly affordable web hosting? With us, what you see is what you get, just click on affordable web hosting services.

January 4th, 2008

directive, you can direct the servlet to import classes, define a general error reporting page, or set a content type. The pagedirective follows the general form shown below: <%@ page attributelist %> You can code one or more page directives in your JSP page. However, with one exception, take care to ensure that you code only one name-value pair per page. The exception is that you may code more than one import attribute, the use of which is explained shortly. You may code page directives anywhere in your JSP page. By convention, page directives are coded at the top of the JSP page. JSP also permits a coding style that follows XML syntax rules. The following is an example of a page directive coded with the XML style: The preceding page directive is the same as the example shown here: <%@ page buffer="8k" %> Table 4-1 lists the allowable list of attributes with a short description of each. Table 4-1: Allowable Page Directive Attributes Page Directive Attributes Short Description buffer Specifies a buffering model for the output stream autoFlush Controls the behavior of the servlet output buffer contentType Defines the character encoding scheme errorPage Defines the URL of another JSP that reports on Java unchecked runtime exceptions isErrorPage Indicates if this JSP page is a URL specified by another JSP page’s errorPageattribute extends Specifies a superclass that the generated servlet must extend import Specifies a list of packages or classes for use in the JSP as the Java importstatement does for Java classes info Defines a string that can be accessed with the servlet s getServletInfo()method isThreadSafe Defines the threading model for the generated servlet language Defines the programming language used in the JSP page. session Specifies whether or not the JSP page participates in HTTP sessions Now let s explore the attributes listed in Table 4-1 in more detail.
Interland Web Hosting is the leader in the industry of discount and affordable web hosting. All plans are feature packed, with 24×7 tech support, automatic backups. You also get visitor statistics, spam filtering, email anti virus, and much more. Web page hosting is generally sufficient only for personal home pages.

January 3rd, 2008

EJB & JSP: Java On The Edge, Unlimited Edition by Lou Marco ISBN: 0764548026 Your Guide to Cutting-Edge J2EE Programming Techniques. Programmable JSP Elements Programmable JSP elements are divided into five categories: directives, scripting elements, declarations, expressions, and actions. Let s take a look at the elements in the first category. JSP Directives JSP directives are JSP elements that send messages to the JSP container. Directives affect the overall structure of the servlet generated from the JSP page. JSP directives do not produce any output to the generated document. The general format of a JSP directive is: <%@ directiveType attributelist %> The first word, directiveType, is one of three values: page, include, and taglib. The second word, attributelist, is one or more name-value pairs; the name part is the name of the attribute relevant to the directive type and the value is a quoted string relevant to the attribute name. If the directive contains more than one name-value pair, the distinct pairs are delimited by one or more spaces, such as the following JSP directive: <%@ page buffer="8k" language="java" %> Note The syntax for name-value pairs is the same as the syntax for XML name-value pairs. See Appendix D, XML Overview, for an overview of XML syntax. Pay heed to the at (@) sign after the <% at the start of the directive; pay equal attention to the absence of the "at" sign at the end of the directive. Also note that the space between the start of the directive and the directiveType is not required. The page Directive The page directive enables you to communicate a number of important attributes to the generated servlet. Using the page
Please check java servlet web hosting services, here you will find professional-grade java servlet web hosting with the best prices.

January 2nd, 2008

EJB & JSP: Java On The Edge, Unlimited Edition by Lou Marco ISBN: 0764548026 Your Guide to Cutting-Edge J2EE Programming Techniques. Summary JSP is useful in Web application programming because it allows us to create dynamic Web pages that leverage the full power of the Java programming language by mixing static HTML and JSP tags. JSP pages are created in a text editor and are interpreted by a JSP container. The JSP container translates JSP pages into Java class files, which are compiled into servlets. JSP offers distinct advantages over competing technologies but is not without its shortcomings. In this chapter we’ve seen our first JSP page examples. In the following chapter we’ll break down the parts of a JSP page and examine them each in turn.
Dear Canadians, choose Canadian Web Hosting and your Canadian website will benefit in every way from the reliability, security, and speed.