我正在使用下面的DOJO功能进行AJAX调用。但不幸的是,缓存特定请求的缓存。即使我改变了servlet端的代码,它也不会反映在我以前尝试过的情况中。我想这个响应被缓存了。我正在使用Tomcat服务器。 任何人都可以帮忙吗?使用DOJO时缓存AJAX响应
<script type="text/javascript">
function showMonth(text) { //
dojo.xhrGet({
// The following URL must match that used to test the server.
url: "ajaxServlet?s="+text,
handleAs: "text",
// The LOAD function will be called on a successful response.
load: function(response, ioArgs) { //
dojo.byId("response").innerHTML = response + "Hereeee"; //
return response; //
},
// The ERROR function will be called in an error case.
error : function(response, ioArgs) { //
console.error("HTTP status code: ", ioArgs.xhr.status); //
dojo.byId("response").innerHTML = 'Loading the ressource from the server did not work'; //
return response; //
},
// Here you put the parameters to the server side program
// We send two hard-coded parameters
content : {
name : "lars",
url : "testing"
}
});
}
谢谢迪米特里。那个工作。并感谢您的额外信息。 – Rob
+1用于解释'preventCache'的工作原理 – undefined