Create Servlet file and study web descriptor file code example

Example: Create Servlet file and study web descriptor file

<?xml version="1.0" encoding="UTF-8"?>
<web-app version="3.1" xmlns="http://xmlns.jcp.org/xml/ns/javaee">
    <servlet>
        <servlet-name>WebServlet</servlet-name>
        <servlet-class>WebServlet</servlet-class>
    </servlet>
    <welecome-file-list>
        <welcome-file>MainPage.html</welcome-file>
           <welcome-file>index.html</welcome-file>
    </welecome-file-list>
   
    <servlet-mapping>
        <servlet-name>WebServlet</servlet-name>
        <url-pattern>/WebServlet</url-pattern>
    </servlet-mapping>
</web-app>

Tags:

Html Example