ajax deletemapping,Spring 3 jquery ajax delete

I am trying to do ajax delete with jquery but getting http error 400.

I was searching and I've seen that there is some problems with delete method in jquery.

Here's my js, controller(spring 3) and request from Chrome.

If you now what is the mistake please tell, or give some links.

$.ajax({

url: 'additions/cancelUpload',

type: 'DELETE',

data: {filename : ui.draggable.get(0).file.name},

success: function (res) {

alert(res);

}

});

execution does not passed here:

@RequestMapping(value = "cancelUpload", produces="text/html")

@ResponseBody

public String cancelUpload(@RequestParam("filename")String filename, HttpSession session ){

...

}

request:

Request URL:http://localhost:8080/WebStore/additions/cancelUpload

Request Method:DELETE

Status Code:400 Bad Request

Request Headersview source

Accept:*/*

Accept-Charset:windows-1251,utf-8;q=0.7,*;q=0.3

Accept-Encoding:gzip,deflate,sdch

Accept-Language:uk-UA,uk;q=0.8,ru;q=0.6,en-US;q=0.4,en;q=0.2

Connection:keep-alive

Content-Length:17

Content-Type:application/x-www-form-urlencoded

Cookie:JSESSIONID=A7DF5CB262C460961BC7B5C7DCB23052

Host:localhost:8080

Origin:http://localhost:8080

Referer:http://localhost:8080/WebStore/items?form

User-Agent:Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/535.1 (KHTML, like Gecko) Chrome/13.0.782.112 Safari/535.1

1X-Requested-With:XMLHttpRequest

Form Dataview URL encoded

filename:6648.jpg

Response Headers

Connection:close

Content-Length:1043

Content-Type:text/html;charset=utf-8

Date:Sat, 26 May 2012 10:03:58 GMT

Server:Apache-Coyote/1.1

X-TraceId:4fc0a8f8-46

X-TraceUrl:/insight/services/traces/4fc0a8f8-46?type=json

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值