在 Javalin 中遇到问题,我的 IntelliJ Idea IDE 中的控制台输出正在输出 400 HTTP 错误代码,在尝试使用:List<Long>
id 参数时出现问题,该参数在其他类中被称为:Long
id 时尝试从名为 WorkoutDAO.java 的数据访问对象为其类 Workout.java 创建新实例。
目前代码编译得很好,它只是当我遍历到出现 400 错误代码的页面时发生的错误。
控制台中的 Javalin 输出以下内容:
[qtp1226622409-20] INFO io.javalin.Javalin - JAVALIN REQUEST DEBUG LOG:
Request: GET [/workouts/list]
Matching endpoint-handlers: [GET=/workouts/:id]
Headers: {Cookie=JSESSIONID=node01ls164g1wqing5fm7jinkalm61.node0, Accept=text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9, Connection=keep-alive, User-Agent=Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/87.0.4280.20 Safari/537.36, Referer=http://localhost:7000/, Sec-Fetch-Site=same-origin, Sec-Fetch-Dest=document, Host=localhost:7000, Accept-Encoding=gzip, deflate, br, Sec-Fetch-Mode=navigate, sec-ch-ua="Google Chrome";v="87", "\"Not;A\\Brand";v="99", "Chromium";v="87", sec-ch-ua-mobile=?0, Upgrade-Insecure-Requests=1, Sec-Fetch-User=?1, Accept-Language=en-US,en;q=0.9}
Cookies: {JSESSIONID=node01ls164g1wqing5fm7jinkalm61.node0}
Body:
QueryString: null
QueryParams: {}
FormParams: {}
Response: [400], execution took 0.44 ms
Headers: {Server=Javalin, Date=Thu, 15 Oct 2020 08:39:45 GMT, Content-Type=text/plain}
Body is 57 bytes (starts on next line):
Path parameter 'id' with value 'list' is not a valid Long
我有人知道如何帮助我解决这个问题。那很好啊。