Reputation: 125
I have created a simple Login Page using Eclipse and have tested and it works perfectly. I have copied the folder of the Project which I called ABC from my eclipse workspace to
(the apache tomcat folder)/webapps
I tried running it by typing
localhost:8080/ABC
but it produce me with the Error 404 Page.
This is my web.xml
file
<?xml version="1.0" encoding="UTF-8"?>
<web-app version="3.0" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd" >
<servlet>
<servlet-name>login</servlet-name>
<servlet-class>Login</servlet-class>
</servlet>
<servlet>
<servlet-name>Welcome</servlet-name>
<servlet-class>Welcome</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>login</servlet-name>
<url-pattern>/login</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>Welcome</servlet-name>
<url-pattern>/Welcome</url-pattern>
</servlet-mapping>
</web-app>
I have also attached images of file path
Upvotes: 1
Views: 1104
Reputation: 775
You need to Export
the Dynamic Web Project
into a .war
and deploy it into the Tomcat Webapps folder and restart the server.
Here are a few steps to help you:
Then restart the server.
Upvotes: 1