Web XML or web.xml File Syntax

What is the syntax of a Web XML File for JSP?


Web XML file is added in for web application developed using Java platform as it defines information about servlets, JSP pages, is also enumerates enterprise beans within a web application.This is the file read by the web service provider to know how to run a web service.

The "web.xml" file is located in the "WEB-INF" folder under web application folder.


<?xml version="1.0" encoding="UTF-8"?>
<web-app version="2.5" xmlns="http://java.sun.com/xml/ns/javaee"
<display-name>MY WEBSITE</display-name>
XML tags

The XML tags contained in this file are for mapping servlets, jsp pages, error pages, specifying session time etc. The tags "<!", ">" is used to display the comments in a web.xml file.

Ask Questions

Ask Question