web.xml

Advertisements

Prev Tutorial Next Tutorial

Servlet Deployment Descriptor Files

It is an xml file which acts as a mediator between a web application developer and a web container. It is also called Deployment Descriptor Files.

web.xml file

Note: we can not change the directory or extension name of this web.xml because it is standard name to recognized by container at run-time.

In web.xml file, we configure the following

  • Servlet
  • JSP
  • Filter
  • Listeness
  • Welcome files
  • Security
  • etc....

To configure a servlet file we need the following two xml tag.

  • <Servlet>
  • <Serlet-mapping>

<servlet>: tag are used for configure the servlet, Within this tag we write Servlet name and class name.

<Serlet-mapping>: tag are used for map the servlet to a URL .

The structure of web.xml files is already defined by sun MicroSystem. So as a developer we should follows the structure to develop the configuration of web resources.

While configuring a servlet in web.xml, three names are added for it.

  • Alias name or register name
  • Fully qualified class name
  • url-pattern

Syntax

<web-app>
<servlet>
<servlet-name>alias name</servlet-name>
<servlet-class>fully qualified class name</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>alias name</servlet-name>
<url-pattern>/url pattern</url-pattern>
</servlet-mapping>
</web-app>

Prev Tutorial Next Tutorial

Google Advertisment

Buy This Ad Space @$20 per Month, Ad Size 600X200 Contact on: hitesh.xc@gmail.com or 9999595223

Magenet is best Adsense Alternative here we earn $2 for single link, Here we get links ads. Magenet

For Projects 9999595223

Google Advertisements


Buy Websites 9999595223

Buy College Projects with Documentation Contact on whatsapp 9999595223. Contact on: hitesh.xc@gmail.com or 9999595223 Try this Keyword C++ Programs

Advertisements