如何在java中从请求中获取参数长html页面字符串?
我用javascript发布请求。我在post数据中发送html页面。在java中,我使用如何在java中从请求中获取参数长html页面字符串?,java,javascript,jquery,html,ajax,Java,Javascript,Jquery,Html,Ajax,我用javascript发布请求。我在post数据中发送html页面。在java中,我使用stringhtml=request.getParameter(“templateHtml”)我在调试模式下看到请求中的html字符串。但“html”变量为空。 我的javascript代码如下: var postData = {}; postData["templateHtml"] = "Html page's string is too long"; $.ajax({ type: 'POST',
stringhtml=request.getParameter(“templateHtml”)代码>我在调试模式下看到请求中的html字符串。但“html”变量为空。
我的javascript代码如下:
var postData = {};
postData["templateHtml"] = "Html page's string is too long";
$.ajax({
type: 'POST',
url: createUrl,
data: postData,
success: function(data) {
onSuccess(data);
},
error: function(message) {
onFail(message);
},
});
为什么我会收到一个空的“html”变量?我怎样才能修好它
var postData = {};
postData["templateHtml"] = "Html page's string is too long";
$.ajax({
contentType: 'application/json',
dataType: 'json',
processData: false,
type: 'POST',
url: createUrl,
data: JSON.stringify(postData),
success: function(data) {
onSuccess(data);
},
error: function(message) {
onFail(message);
},
});
我将post数据转换为JSON。它现在正在工作。html变量在哪里?“String html=request.getParameter(“templateHtml”);”