前提
ThymeleafでDBから取得したリスト型の値をtextareaに入れたいのですが、
「Whitelabel Error Page」になってしまいます。
ご教示お願いいたします。
実現したいこと
リスト内の値をth:eachで全て表示させたいです。
発生している問題・エラーメッセージ
2022-07-18 19:33:18.564 ERROR 7992 --- [nio-8080-exec-1] org.thymeleaf.TemplateEngine : [THYMELEAF][http-nio-8080-exec-1] Exception processing template "top": Error during execution of processor 'org.thymeleaf.spring5.processor.SpringTextareaFieldTagProcessor' (template: "top" - line 44, col 77) org.thymeleaf.exceptions.TemplateProcessingException: Error during execution of processor 'org.thymeleaf.spring5.processor.SpringTextareaFieldTagProcessor' (template: "top" - line 44, col 77) 2022-07-18 19:33:18.568 ERROR 7992 --- [nio-8080-exec-1] o.a.c.c.C.[.[.[/].[dispatcherServlet] : Servlet.service() for servlet [dispatcherServlet] in context with path [] threw exception [Request processing failed; nested exception is org.thymeleaf.exceptions.TemplateProcessingException: Error during execution of processor 'org.thymeleaf.spring5.processor.SpringTextareaFieldTagProcessor' (template: "top" - line 44, col 77)] with root cause
該当のソースコード
対象箇所の抜粋
text部分はうまくいくのですが、textarea部分でエラーになってしまいます。
text部分でうまくいってるので、リストには正常に値が入ってる認識です。
<tr th:each="obj : ${shopList}"> <td th:text="${obj.shopId}"></td> <td> <input type="text" th:value="${obj.shopNm}"></td> <td> <input type="text" th:value="${obj.unit}"></td> <td> <input type="text" th:value="${obj.openHours}"></td> <td> <textarea name="openHours" rows="10" cols="40" autofocus="autofocus" th:field=${obj.openHours}></textarea></td> </tr>
回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2022/07/21 15:12