Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Servlet.service() for servlet [dispatcherServlet] in context with path [] threw exception [Request processing failed; nested exception is com.samskivert.mustache.MustacheException$Context: No method or field with name 'text' on line 8] with root cause
- @PostMapping("/main")
- public String add(@RequestParam String text, Map<String,Object>model){
- Message message=new Message(text);
- messageRepo.save(message);
- Iterable<Message> messages=messageRepo.findAll();
- model.put("messages", messages);
- return "/main";
- }
- <!DOCTYPE HTML>
- <html>
- <body>
- <div>Список сообщений</div>
- <div>
- <span>{{text}}</span>
- </div>
- </body>
- </html>
Add Comment
Please, Sign In to add comment