1

Я только начинаю изучать spring, для простоты взяла bootstrap и freemarker. При использовании метода с @PathVariable возникает ошибка с бутстрапом, даже не смотря на то, что темплейт пустой. На рабочем компе нет интернета, поэтому я подключила бутстрап и его зависимости методом скачивания. Я ещё не пробовала поменять на ссылки, но может в этом дело.. Я пробовала менять @PathVariable, и каждый раз получала разные ошибки. Если убрать эту анотацию или убрать бутстрап, то ошибок не возникает. Не могу понять в чём тут дело :(

Текст ошибки:

2020-10-14 21:02:12.409  WARN 25556 --- [nio-8081-exec-1] .w.s.m.s.DefaultHandlerExceptionResolver : Resolved [org.springframework.web.method.annotation.MethodArgumentTypeMismatchException: Failed to convert value of type 'java.lang.String' to required type 'com.consents.autoreport.entity.PprbSystem'; nested exception is org.springframework.core.convert.ConversionFailedException: Failed to convert from type [java.lang.String] to type [java.lang.Integer] for value 'bootstrap.min.js'; nested exception is java.lang.NumberFormatException: For input string: "bootstrap.min.js"]
2020-10-14 21:02:12.409  WARN 25556 --- [nio-8081-exec-5] .w.s.m.s.DefaultHandlerExceptionResolver : Resolved [org.springframework.web.method.annotation.MethodArgumentTypeMismatchException: Failed to convert value of type 'java.lang.String' to required type 'com.consents.autoreport.entity.PprbSystem'; nested exception is org.springframework.core.convert.ConversionFailedException: Failed to convert from type [java.lang.String] to type [java.lang.Integer] for value 'popper.min.js'; nested exception is java.lang.NumberFormatException: For input string: "popper.min.js"]
2020-10-14 21:02:12.409  WARN 25556 --- [nio-8081-exec-8] .w.s.m.s.DefaultHandlerExceptionResolver : Resolved [org.springframework.web.method.annotation.MethodArgumentTypeMismatchException: Failed to convert value of type 'java.lang.String' to required type 'com.consents.autoreport.entity.PprbSystem'; nested exception is org.springframework.core.convert.ConversionFailedException: Failed to convert from type [java.lang.String] to type [java.lang.Integer] for value 'bootstrap.min.css'; nested exception is java.lang.NumberFormatException: For input string: "bootstrap.min.css"]
2020-10-14 21:02:12.409  WARN 25556 --- [nio-8081-exec-9] .w.s.m.s.DefaultHandlerExceptionResolver : Resolved [org.springframework.web.method.annotation.MethodArgumentTypeMismatchException: Failed to convert value of type 'java.lang.String' to required type 'com.consents.autoreport.entity.PprbSystem'; nested exception is org.springframework.core.convert.ConversionFailedException: Failed to convert from type [java.lang.String] to type [java.lang.Integer] for value 'jquery-3.5.1.slim.min.js'; nested exception is java.lang.NumberFormatException: For input string: "jquery-3.5.1.slim.min.js"]
2020-10-14 21:02:12.478  WARN 25556 --- [nio-8081-exec-6] .w.s.m.s.DefaultHandlerExceptionResolver : Resolved [org.springframework.web.method.annotation.MethodArgumentTypeMismatchException: Failed to convert value of type 'java.lang.String' to required type 'com.consents.autoreport.entity.PprbSystem'; nested exception is org.springframework.core.convert.ConversionFailedException: Failed to convert from type [java.lang.String] to type [java.lang.Integer] for value 'popper.min.js'; nested exception is java.lang.NumberFormatException: For input string: "popper.min.js"]
2020-10-14 21:02:12.493  WARN 25556 --- [nio-8081-exec-7] .w.s.m.s.DefaultHandlerExceptionResolver : Resolved [org.springframework.web.method.annotation.MethodArgumentTypeMismatchException: Failed to convert value of type 'java.lang.String' to required type 'com.consents.autoreport.entity.PprbSystem'; nested exception is org.springframework.core.convert.ConversionFailedException: Failed to convert from type [java.lang.String] to type [java.lang.Integer] for value 'bootstrap.min.js'; nested exception is java.lang.NumberFormatException: For input string: "bootstrap.min.js"]
@GetMapping("{system}")
public String getSystemById(@PathVariable PprbSystem system, Model model) {
    model.addAttribute("system", system);
    model.addAttribute("isEmpty", system.getDashboards().isEmpty());
    return "system-page";
}



<#macro page>
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8"/>
    <title>Title</title>
    <link rel="stylesheet" href="bootstrap.min.css"/>
</head>
<body>
<div class="container mt-5">
    <#nested>
</div>
<script src="jquery-3.5.1.slim.min.js"></script>
<script src="popper.min.js"></script>
<script src="bootstrap.min.js"></script>
</body>
</html>
</#macro>

Сам шаблон - просто пустой

    <#import "parts/common.ftlh" as c>

<@c.page>

</@c.page>

0

Ваш ответ

By clicking “Отправить ответ”, you agree to our terms of service and acknowledge you have read our privacy policy.

Посмотрите другие вопросы с метками или задайте свой вопрос.