Guest User

Untitled

a guest
Dec 16th, 2018
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.68 KB | None | 0 0
  1. 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
  2.  
  3.  
  4. @PostMapping("/main")
  5. public String add(@RequestParam String text, Map<String,Object>model){
  6. Message message=new Message(text);
  7. messageRepo.save(message);
  8. Iterable<Message> messages=messageRepo.findAll();
  9. model.put("messages", messages);
  10. return "/main";
  11. }
  12.  
  13. <!DOCTYPE HTML>
  14. <html>
  15. <body>
  16.  
  17. <div>Список сообщений</div>
  18.  
  19. <div>
  20. <span>{{text}}</span>
  21. </div>
  22.  
  23. </body>
  24. </html>
Add Comment
Please, Sign In to add comment