oschina_41140683
liang墨竹
2017-11-22 08:20

spring-boot页面跳转失败,请指教,谢谢!!!

  • spring
  • 页面跳转
  • 启动
  • 跳转

App类:

 package com.yss.springboot.application;

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

@SpringBootApplication
public class App {

    public static void main(String[] args) {

        SpringApplication.run(App.class, args);
    }
}

HelloWorldController类:

 package com.yss.springboot.controller;

import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * Hello World
 * @author yss
 *
 */
@RestController
public class HelloWorldController {

    @RequestMapping("/")
    public String sayHello() {
        return "Hello World!";
    }
}

浏览器输入:localhost:8080页面错误,无法跳转!

  • 点赞
  • 回答
  • 收藏
  • 复制链接分享

3条回答