springMVC controller中方法接收参数问题,怎么接收json对象

后台配置及代码

 <bean id="paramMethodResolver" class="org.springframework.web.servlet.mvc.multiaction.ParameterMethodNameResolver">
    <property name="paramName" value="method"></property>
 </bean>
 <!-- 下边配置请求 -->
 <bean name="/busi/userInfo.action" class="com.mxci.busi.control.impl.UserInfoControllerImpl">
        <property name="methodNameResolver">
            <ref bean="paramMethodResolver"/><!-- 引用上边那个方法名称解析器 -->
        </property>
 </bean>

public String regist(HttpServletRequest request, HttpServletResponse response, UserInfo userInfo) {
// TODO Auto-generated method stub
LOGGER.info("[CR]商户注册开始.请求商户信息:"+userInfo);
MxciInsideResult mxciInsideResult = userInfoService.busiCustRegist(userInfo);//调用
//组装响应数据,并初始化进MxciResponseBody里面
MxciResponseServiceImpl mxciResponseService
= new MxciResponseServiceImpl(mxciInsideResult.getRecode(),mxciInsideResult.getReData(),response);
mxciResponseService.response();//响应结果到客户端
mxciResponseService=null;//置空
return null;
}

目前请求地址这样写是可以封装层userId对象的
http://127.0.0.1:8090/mxciBusiness/busi/userInfo.action?method=regist&userId=wangyan&password=900613&certificateId=50022419901231739X&phoneNo=18696668026

请问怎么样修改才能用下边的地址访问能让后台接收到对象呢???
http://127.0.0.1:8090/mxciBusiness/busi/userInfo.action?method=regist&userInfo={"userId": "wangyan888","customerId": "BUSI20160125000001","lastErrorTime": null,"loginDate": null,"loginErrNum": 0,"password": "","phoneNo": "18696668026","reginDate": null,"status": 0,"valiDate":null}

查看全部
vanseparis
vanseparis
2016/01/26 01:03
  • spring
  • 对象
  • json
  • 点赞
  • 收藏
  • 回答
    私信

5个回复