0

I want to create a web application. I had written the code in servlets and html file as shown in the following Project Structure.

Web.xml for project is

<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
 xmlns="https://jakarta.ee/xml/ns/jakartaee" 
 xmlns:web="http://xmlns.jcp.org/xml/ns/javaee" 
 xsi:schemaLocation="https://jakarta.ee/xml/ns/jakartaee 
 https://jakarta.ee/xml/ns/jakartaee/web-app_5_0.xsd" id="WebApp_ID" version="5.0">
 <display-name>Web_Project</display-name>
    <servlet>
        <servlet-name>Add</servlet-name>
        <servlet-class>mypackage.AddServlet</servlet-class>
    </servlet>

    <servlet-mapping>
         <servlet-name>Add</servlet-name>
         <url-pattern>/add</url-pattern>
    </servlet-mapping>

    <servlet>
        <servlet-name>welcome</servlet-name>
        <servlet-class>mypackage.WelcomeServlet</servlet-class>
    </servlet>

    <servlet-mapping>
         <servlet-name>welcome</servlet-name>
         <url-pattern>/welcome</url-pattern>
    </servlet-mapping>


    <welcome-file-list>
        <welcome-file>index.html</welcome-file>
        <welcome-file>index.jsp</welcome-file>
        <welcome-file>index.htm</welcome-file>
        <welcome-file>default.html</welcome-file>
        <welcome-file>default.jsp</welcome-file>
        <welcome-file>default.htm</welcome-file>
    </welcome-file-list>
 </web-app>*

When I run the project on server getting the following error message

I am getting the similar error message for localhost:8080. Although Tomcat server is started.

BalusC
  • 1,082,665
  • 372
  • 3,610
  • 3,555

0 Answers0