Understanding Deployment Descriptor in Reference with ServletsAs the name indicates deployment descriptor is a text file written in XML format for the purpose of deployment of a web application by deciding its operating parameters. Every web application has a specific deployment descriptor which governs its deployment on the server. Here we will understand deployment descriptor in reference with servlets. Generally deployment descriptor is called web.xml and it is placed inside the WEB-INF subdirectory of web application which is at the root of the application. The structure of web.xml is like an XML document and it can be divided into three parts. XML header is the usual header part indicating version and encoding of XML. DOCTYPE tag is used to specify the URL for the DTD file of deployment descriptor. The web-app component is further divided into three sub-components. We will understand them with the help of following example: <?xml version-“1.0” encoding="ISO-8859-1"?> <!DOCTYPE web-app SYSTEM "web-app_2_5.dtd"> We can declare multiple servlets in a web.xml by defining their names and corresponding class names under the servlet-name and servlet-class elements but their names should be unique across the web.xml. Also in addition to these components, we have servlet-mapping component, which maps the servlet to a url. This means that the servlet declared here will be requested when a url matching with the value in url-pattern element will be called by the web server. So deployment descriptor contains the important data which is needed by the application at the runtime for doing the necessary configuration. Also web.xml contains vital security information which is necessary while accessing the application. It has security-constarint element for this. Also inside servlet element we have sub component security-role-ref which has the reference to name of security role assigned to the element.
| All About Different Types of XML Editors | Generating XML Document Using JSP | How to Retrieve an Email Message Using Java Mail API | How to Send an Email Message Using Java Mail API | Transforming XML Data with XSLT | Understanding Basic Components of a JMS Program | Understanding Basic Technology of ebXML | Understanding Deployment Descriptor in Reference with Servlets | Understanding eXtensible Access Control Markup Language (XACML) | Understanding the Design Goals of XML | Understanding XML Common Biometric Format | |
|
|||
|
||||
“Amazon and the Amazon logo are trademarks of Amazon.com, Inc. or its affiliates.”
Copyright - © 2004 - 2019 - All Rights Reserved.