Chapter 7: Web Application Confi guration Element Description How Many? Restricts access to a resource to a required transport guarantee and by user role Defines authentication parameters Declares a security role by name Defines a Web application s environment entry Declares a reference to an EJB s home Declares a reference to an EJB s local home 0 or more 0 or 1 0 or more 0 or more 0 or more 0 or more In the following sections, you examine a minimal web.xml file to understand what must be present. The XML Header Every web.xml file complies with the XML specifications that require an XML header in the beginning of the file, as shown here: Optionally, the declaration may also include an encoding type that identifies the character encoding of the document, as is standard for XML. For example, if the document is encoded in UTF-8, the declaration may be provided as follows: The DTD Declaration The next tag is a Document Type Definition (DTD) tag. A DTD is a document that outlines the structure of the web.xml elements, what elements are allowed and in which order, and their content. The inclusion of a standard DTD declaration in our web.xmlfile looks as follows: Applications that comply with the Servlet specifications prior to 2.3, such as Tomcat 3 web.xmlfiles, for example, will have the following DTD reference: Backward compatibility is required as per the Servlet 2.3 specifications, so applications that were written for the Servlet 2.2 specifications will work unaltered on Tomcat 6, except for any dependencies on the exact configuration of the server (such as the location of databases, network authentication, and the name of the server and the host). Because the Servlet 2.3 specifications have introduced a number of new tags since 2.2, we will also highlight these tags where appropriate.
If you looking for unlimited one inclusive web hosting plan please check web hosting plan website.
This entry was posted
on Wednesday, April 1st, 2009 at 11:17 am and is filed under tomcat.
You can follow any responses to this entry through the RSS 2.0 feed.
Responses are currently closed, but you can trackback from your own site.