ajax请求不到action,spring mvc action接收不到 前台ajax请求有关问题! 待中…

当前位置:我的异常网» Java Web开发 » spring mvc action接收不到 前台ajax请求有关问题!

spring mvc action接收不到 前台ajax请求有关问题! 待中…

www.myexceptions.net  网友分享于:2013-09-10  浏览:173次

spring mvc action接收不到 前台ajax请求问题!! 在线等待中……

前台使用的js  ajax方式提交请求,如下代码

function getImgPathByCond()

{

$("#chartPanel").html('');

var dateType = $(":radio").filter(":checked").val();

var beginDate = $('#chart_start_time').attr('value');

var endDate = $('#chart_end_time').attr('value');

var url = "/ctrlmStatistics/historyGraph.do";

alert(url);    //此处能显示

$.post(   //从这里开始就没反应了

url,

{svrId:1,chartType:bar,dateType:month,beginDate:beginDate,endDate:endDate,width:880 ,height:660},

function(result){

        $("#chartPanel").html('');

        $("#chartPanel").html('');

//显示滚动条,查询条件展示块display='none'

},

"txt"

);

}

//框架为spring mvc  后台此映射截取不到$.post(……)

@RequestMapping("/ctrlmStatistics/historyGraph.do")

@ResponseBody

public String historyGraph(HttpServletRequest request,HttpServletResponse response)throws Exception {

String chartType = request.getParameter("chartType");

String dateType = request.getParameter("dateType");

String start_time=request.getParameter("beginDate");

String end_time=request.getParameter("endDate");

String svrId=request.getParameter("svrId");

if("day".equals(dateType))

{

}

else//按月查询

{

start_time=start_time.replace("-", "");

end_time=end_time.replace("-", "");

/*start_time=InitMonthDate(start_time);

end_time=InitMonthDate(end_time);*/

}

String templateId = "";//二期如果加上模版id的话,从前台获取id传入

String imgPath = statisticsChartService.getHistoryChart(templateId,

chartType, dateType, start_time, end_time, svrId, request);

return imgPath;

文章评论