关于 request type = put 在tomcat上如何配置

[quote]
https://blog.csdn.net/kthq/article/details/5157822
[/quote]

function getXMLHTTPRequest(){
if (XMLHttpRequest) {
return new XMLHttpRequest();
} else {
try{
return new ActiveXObject('Msxml2.XMLHTTP');
}catch(e){
return new ActiveXObject('Microsoft.XMLHTTP');
}
}
}
var req = getXMLHTTPRequest();
req.open('DELETE','http://localhost/test.jsp',false);
req.send(null);
document.write(req.responseText);


[quote]

在Tomcat的web.xml 文件中配置 org.apache.catalina.servlets.DefaultServlet 的初始化参数

[xhtml] view plain copy

readonly
false

readonly参数默认是true,即不允许delete和put操作,所以默认的通过XMLHttpRequest对象的put或者delete方法访问就会报告 http 403 forbidden 错误。

[/quote]

你可能感兴趣的:(requestType)