Bootstrap

JQuery:后台接收Json串与对象

一、接收对象

@RequestParam可以处理get 方式中queryString的值,也可以处理post方式中 body data的值。@RequestParam用来处理Content-Type: 为 application/x-www-form-urlencoded编码的内容,提交方式GET、POST。

<script src="http://libs.baidu.com/jquery/1.9.0/jquery.js"></script>
<script>
        $(document).ready(function(){
            $("#btn").click(function() {
                var opt = {"idCard":"511487456854721458","key":"12345"}
                $.ajax({
                    url: "http://127.0.0.1:80/custem/admin/admin_login",
                    type: "get",
                    data: opt,
                    contentType :