2014년 3월 2일 일요일

자바스크립트에서 스프링의 모델쪽 값읽어오기(javascript, get spring model value), spring framework, javascript, spring model @Controller @RequestMap

자바스크립트에서 스프링의 모델쪽 값읽어오기(javascript, get spring model value), spring framework, javascript, spring model

@Controller
@RequestMapping("/onj")
public class OnjController {

    @RequestMapping(value="/{name}", method = RequestMethod.GET)
    public String getMovie(@PathVariable String name, ModelMap model) {

        model.addAttribute("who", name);
        return "list";

    }

}



<html>
<head>
<script type="text/javascript">
var movie_name = "${who}";
alert("who"+ who);
</script>
</head>
<body>
    <h3>Name : ${who}</h3>
</body>
</html>

댓글 없음:

댓글 쓰기