<output id="qn6qe"></output>

    1. <output id="qn6qe"><tt id="qn6qe"></tt></output>
    2. <strike id="qn6qe"></strike>

      亚洲 日本 欧洲 欧美 视频,日韩中文字幕有码av,一本一道av中文字幕无码,国产线播放免费人成视频播放,人妻少妇偷人无码视频,日夜啪啪一区二区三区,国产尤物精品自在拍视频首页,久热这里只有精品12

      spring mvc ajax 提交復雜數組類型

      The server refused this request because the request entity is in a format not supported by the requested resource for the requested method

      1、Spring Mvc 配置

      <?xml version="1.0" encoding="UTF-8"?>
      <beans xmlns="http://www.springframework.org/schema/beans"
             xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:tx="http://www.springframework.org/schema/tx"
             xmlns:context="http://www.springframework.org/schema/context"
             xmlns:mvc="http://www.springframework.org/schema/mvc"
             xsi:schemaLocation="http://www.springframework.org/schema/beans
          http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
          http://www.springframework.org/schema/tx
          http://www.springframework.org/schema/tx/spring-tx-3.0.xsd
          http://www.springframework.org/schema/context
          http://www.springframework.org/schema/context/spring-context-3.0.xsd
          http://www.springframework.org/schema/mvc
          http://www.springframework.org/schema/mvc/spring-mvc-3.0.xsd">
          <context:component-scan base-package="com.test.controller">
          </context:component-scan>
          <bean class="org.springframework.web.servlet.view.InternalResourceViewResolver">
              <property name="prefix" value=""></property>
              <property name="suffix" value=".jsp"></property>
          </bean>
          <bean class="org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter">
              <property name="messageConverters">
                  <list>
                      <bean class="org.springframework.http.converter.ByteArrayHttpMessageConverter"/>
                      <bean class="org.springframework.http.converter.StringHttpMessageConverter">
                          <property name="supportedMediaTypes">
                              <list>
                                  <value>text/html; charset=utf-8</value>
                                  <value>application/json; charset=utf-8</value>
                              </list>
                          </property>
                      </bean>
                      <bean class="org.springframework.http.converter.ResourceHttpMessageConverter"/>
                      <bean class="org.springframework.http.converter.xml.SourceHttpMessageConverter"/>
                      <bean class="org.springframework.http.converter.xml.XmlAwareFormHttpMessageConverter"/>
                      <bean class="org.springframework.http.converter.xml.Jaxb2RootElementHttpMessageConverter"/>
                      <bean class="org.springframework.http.converter.json.MappingJackson2HttpMessageConverter"></bean>
                  </list>
              </property>
          </bean>
          <mvc:annotation-driven />
          <mvc:default-servlet-handler />
      </beans>

      引用 jackson jar包:jackson-annotations-2.1.1.jar、jackson-core-2.1.1.jar、jackson-databind-2.1.1.jar。

      2、Controller代碼

      package com.test.controller;
      
      import org.springframework.stereotype.Controller;
      import org.springframework.stereotype.Repository;
      import org.springframework.web.bind.annotation.RequestBody;
      import org.springframework.web.bind.annotation.RequestMapping;
      import org.springframework.web.bind.annotation.RequestParam;
      import org.springframework.web.bind.annotation.ResponseBody;
      
      import javax.servlet.http.HttpServletRequest;
      import java.util.ArrayList;
      import java.util.List;
      
      /**
       * Created by Administrator on 2015/2/28.
       */
      @Controller
      @RequestMapping("/report")
      public class ReportTypeController extends BaseController {
      
      
          @RequestMapping("/set")
          @ResponseBody
          public String set(@RequestBody List<User> settingBeans,HttpServletRequest request){return "";
          }
      }

      3、ajax請求:

             var userList= new Array();
                  userList.push({id:1,name:"zhangsan"});
                  userList.push({id:2,name:"lisi"});
                  $.ajax({
                      url: "/report/set",
                      type:"post",
                      data:JSON.stringify(userList),
                      dataType:"json",
                      contentType:"application/json",
                      success:function(data){
                      },error:function(data){
                      }
                  });

       如果實體中某個boolean屬性定義為isFirst,js中為此屬性傳值的時候應為:{first:true}之類

      posted @ 2015-03-03 18:51  tyb1222  閱讀(7629)  評論(0)    收藏  舉報
      主站蜘蛛池模板: 最新的国产成人精品2020| 日本三级香港三级三级人!妇久 | 高清自拍亚洲精品二区| 国产精自产拍久久久久久蜜| 日本深夜福利在线观看| 久久精品国产99久久美女| 色宅男看片午夜大片啪啪| 人妻丝袜AV中文系列先锋影音| 国产美女久久久亚洲综合 | 欧美亚洲一区二区三区在线| 4虎四虎永久在线精品免费| 国产亚洲精品久久久久久久软件| 国产乱人激情H在线观看| 国产免费一区二区不卡| 91老肥熟女九色老女人| 香港日本三级亚洲三级| 免费视频欧美无人区码| 在线a人片免费观看| 99久久精品国产一区二区| 大香伊蕉在人线国产免费| 精品国产高清中文字幕| 她也色tayese在线视频| 日韩放荡少妇无码视频| 青青草无码免费一二三区| 国产精品国产精品偷麻豆| 亚洲男女羞羞无遮挡久久丫| 亚洲一区二区| 国产亚洲一区二区三区av| 亚洲人妻精品一区二区| 丁香花在线观看免费观看图片| 性欧美欧美巨大69| 亚洲中文久久久精品无码| 国产高清在线a视频大全| 九九热免费在线视频观看| 国产偷窥熟女高潮精品视频| 欧美成人精品手机在线| 夜夜影院未满十八勿进| 91中文字幕一区在线| 阿克陶县| 亚洲av日韩av中文高清性色| 深夜国产成人福利在线观看|