第一次访问本机上的spring-boot报错:java.lang.NumberFormatException: For input string: "index"

具体的报错情况:Failed to convert value of type 'java.lang.String' to required type 'int'; nested exception is java.lang.NumberFormatException: For input string: "index"

查找了下说的是类型错误,第一次外部访问的时候就是老是报错这个东东,具体的原因就是直接端口访问的时候返回的默认“index”这个界面上,但是它要在static下面,解决方法:

在控制层新建一个类,默认第一次访问它:

@Controller
public class FirstPage {

    @RequestMapping("/")
    public String index(){
        return "/static/index.html";
    }
}

你可能感兴趣的:(第一次访问本机上的spring-boot报错:java.lang.NumberFormatException: For input string: "index")