我有一个错误与 Spring 开机和后的要求总是掩盖。
我犯了什么错误?
代码:
package com.endsurve.panel.account.register;
import com.endsurve.panel.logger.Logger;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.servlet.ModelAndView;
@Controller
public class Register {
@RequestMapping(method = RequestMethod.POST, path = "/registerAccount")
@ResponseBody
public ModelAndView registerToken(@RequestParam(value = "token") String token) {
ModelAndView modelAndView = new ModelAndView();
Logger.getInstance().log("Fehler!");
Logger.getInstance().log("Token: " + token);
modelAndView.setViewName("error");
return modelAndView;
}
}
html格式:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Title</title>
</head>
<body>
<form action="registerAccount" method="post">
<div>
<h1>Token</h1>
<input type="text" name="token" placeholder="Token" id="token">
</div>
<button type="submit">Submit</button>
</form>
</body>
</html>
错误:
2020-11-24 14:23:11.742 DEBUG 7340 --- [nio-8080-exec-7] o.s.web.servlet.DispatcherServlet : "ERROR" dispatch for POST "/error", parameters={masked}
2020-11-24 14:23:11.743 DEBUG 7340 --- [nio-8080-exec-7] s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped to org.springframework.boot.autoconfigure.web.servlet.error.BasicErrorController#errorHtml(HttpServletRequest, HttpServletRes
ponse)
暂无答案!
目前还没有任何答案,快来回答吧!