'Deploy War File 404 HTTP

I'm new with Java stuffs and I'm trying to deploy a form. I following these steps:

cd form_spring_java
mvn clean package
cd target
copy war file to tomcat/webapps/

before deploy, I ran java -jar file.war to test the application and worked.

In Tomcat, the application shows up, table Applications, I can stop, start without error, but access the link, I receive a HTTP 404 - Not found.

package com.example.handlingformsubmission;

    
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.web.servlet.support.SpringBootServletInitializer;

import org.springframework.boot.builder.SpringApplicationBuilder;



@SpringBootApplication

public class HandlingFormSubmissionApplication extends SpringBootServletInitializer{



    public static void main(String[] args) {

        SpringApplication.run(HandlingFormSubmissionApplication.class, args);

    }



    @Override

    protected SpringApplicationBuilder configure(SpringApplicationBuilder builder) {

        return builder.sources(HandlingFormSubmissionApplication.class);

    }



}


Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source