控制器未映射 [英] Controller not getting mapped

查看:63
本文介绍了控制器未映射的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的控制器未在控制台中映射.

My controller is not getting mapped in the console.

我的主类应用

package com.ruchi.web.sbfirst;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;

@SpringBootApplication
public class SbFirstApplication {

    public static void main(String[] args) {
        SpringApplication.run(SbFirstApplication.class, args);
    }

}

登录控制器

package com.ruchi.web.sbfirst.controller;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

@Controller
public class LoginController {

    @RequestMapping("/login")
    public String loginMessage() {
        return "Hello";
    }

}

推荐答案

单击您的项目并转到 gradle 或 maven(您曾经使用过的)并刷新它,然后构建您的项目,现在重新运行它时间它不会让你失望 :)

click on the your project and go to the gradle or maven (which ever you have used) and refresh it then built your project and now re-run it this time it will not disappoint your :)

这篇关于控制器未映射的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆