変数 = リポジトリ.getOne( id );
※リストが表示されない場合
AddBlockなどの広告ブロックツールがONになっているとリストなどが表示されない場合があります。これらのツールをOFFにしてみてください。
※helo.jspのボディ <body> <h1>Hello!</h1> <form method="post" action="/find"> <input type="text" name="find"><br> <input type="submit"> </form> <p class="msg">${datas}</p> <hr> <form method="post" action="/post"> <input type="text" name="name"><br> <input type="text" name="mail"><br> <input type="text" name="tel"><br> <input type="text" name="age"><br> <input type="submit"> </form> </body> ※SampleControllerへ追加するメソッド @RequestMapping(value="/find", method=RequestMethod.POST) public String find(Model model, @RequestParam("find") int id) { MyData data = repository.getOne(id); model.addAttribute("datas", data); return "helo"; }
<< 前へ | 次へ >> |