I've been struggling for days trying to figure out the solution to my problem.
I'm trying to develop a Web Application in Java with Tomcat.

This is my project stracture:

[![Project Structure](https://i.stack.imgur.com/QvhSh.png)](https://i.stack.imgur.com/QvhSh.png)

From what I've read I know that .jsp files should be placed in web directory, but when I do so I get a:

> 
> HTTP Status [404] – [Not Found]
> 
> 
> 

from the server which is not happening if all my .jsp files are placed directly inside "simpleLogin".

Furthermore this is my **index.jsp**:

```
<html>
<head>
    <title>Title</title>
</head>
<body>
<form method="post" action="LoginCheck"> <%--Action shows you where to go, we want to go from jsp to a servlet--%>
    <table>
        <tr>
            <td>
                UserName:
            </td>
            <td>
                <input type="text" name="username"/>
            </td>
        </tr>
        <tr>
            <td>
                Password:
            </td>
            <td>
                <input type="text" name="password"/>
            </td>
        </tr>
        <tr>
            <td></td>
            <td><input type="submit" value="login"/></td>
        </tr>
    </table>
</form>
</body>
</html>

```

This is my **LoginCheck** servlet class:

```
package example;

import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import java.io.IOException;

/**
 * Created by AGDS on 5/23/2017.
 */
@WebServlet("/LoginCheck")
public class LoginCheck extends HttpServlet {
    protected void doPost(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) throws javax.servlet.ServletException, IOException {

        //It will check weither username or password is correct

        String username = request.getParameter("username");
        String password = request.getParameter("password");

        System.out.println(System.getProperty("user.dir"));
        try {
            if (username.equals("java") && password.equals("1234")) {
                //Go to member's page
                response.sendRedirect("member.jsp");

            } else {
                //Go to error page
                response.sendRedirect("error.jsp");
            }
        } catch (Exception e) {
        }

    }

    protected void doGet(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) throws javax.servlet.ServletException, IOException {

    }
}

```

And this is my **web.xml**:

```
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns="http://xmlns.jcp.org/xml/ns/javaee"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-app_3_1.xsd"
         version="3.1">
    <listener>
        <listener-class>com.sun.xml.ws.transport.http.servlet.WSServletContextListener</listener-class>
    </listener>
    <servlet>
        <servlet-name>LoginCheck</servlet-name>
        <servlet-class>example.LoginCheck</servlet-class>
    </servlet>
    <servlet-mapping>
        <servlet-name>LoginCheck</servlet-name>
        <url-pattern>/LoginCheck</url-pattern>
    </servlet-mapping>
</web-app>

```

Now if I tried to hit the submit button that would result again to:

> 
> HTTP Status [404] – [Not Found]
> 
> 
> 

I suppose that something's wrong with my paths and the location that my .jsp files are located or something's wrong with my mapping in the web.xml .

Any suggestion/proposal would be appreciated!