Fouzy
Fouzy

Reputation: 125

Import Eclipse project workspace to Apache tomcat folder

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

ABC folder

ABC/WebContent

Upvotes: 1

Views: 1104

Answers (1)

Sourav Purakayastha
Sourav Purakayastha

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:

Click on Export>WAR

Select the Tomcat Webapps folder

Then restart the server.

Upvotes: 1

Related Questions