I am creating a simple Java web application "Registration Form". I am using following hardware and softwares:
Machine: Amazon Linux 2 EC2 Instance.
Java version: 1.8.0_282
Apache Tomcat: 7.0.76
Servlet: 3.1.0 (In pom.xml group ID: javax.servlet, artifactId: javax.servlet-api)
Note: I am not using any IDE. I am writing code using Linux vim utility.
I am following below steps in order to create Java web application project "Registration Form".
1. Create project directories and pom.xml using
2. Directory structure looks like below:
3. I have added servlet dependency in pom.xml
4. Write code in pom.xml, index.jsp, myStyle.css, register.jsp, guru_register.java, web.xml. Code is shown below.
5. When I execute "mvn clean package" it build the project successfully. After deployment to Tomcat server it display the register.jsp page correctly. After fill data and press submit button it throws error "HTTP Status 404 - /JavaWebApplication/jsp/guru_register". I do not understand why it is looking guru_register page in /jsp folder. Can you please see the code and help me to find the issue?
Note: Due to some limitation I cannot use Windows OS and any IDE so I am using Amazon Linux EC2 for practice. Thank you!