How to kill javaw.exe

I am learning Spring MVC using Maven project and I am facing a problem. This is my controller:

@Controller
public class HelloWorldController {

    @RequestMapping("/hello")
    public String hello(Model model) {
        model.addAttribute("greeting", "Hello Spring MVC");
        return "helloworld";
    }
}

      

I run my project this way (I am using Eclip Neon): Right click on the project> Run As> Run Configs> Right Click on Maven Build> Build> Enter name, base directory and targets> Apply> Run. Done.

When I access this url

http: // localhost: 8080 / DemoSpringMVC / hello

the "helloworld" page will be displayed, it's simple.

Now I want to change @RequestMapping ("/ hello") to @RequestMapping ("/ hello1") like this

@Controller
public class HelloWorldController {

    @RequestMapping("/hello1")
    public String hello(Model model) {
        model.addAttribute("greeting", "Hello Spring MVC");
        return "helloworld";
    }
}

      

I run my project again, access this url and I got the "The requested resource is not available" error.

http: // localhost: 8080 / DemoSpringMVC / hello1

I am trying to access this and "helloworld" is still displayed

http: // localhost: 8080 / DemoSpringMVC / hello

I open up the task manager and I figure out that "javaw.exe" creates a new instance every time I run my project, but the old version always affects. I am trying to destroy all "javaw.exe" manually, run the project again and it works.

So the question is, how do I kill the old "javaw.exe" process every time I start my project ??? Or maybe I am building or running the Maven project incorrectly?

RESOLVED: I understand that I can start the maven project by following the normal path (by tomcat), then the problem is solved. Thanks everyone.

+3


source to share


1 answer


Instead of working a second time, you probably want to redeploy your current code. See https://www.mkyong.com/eclipse/how-to-configure-hot-deploy-in-eclipse/



0


source







All Articles