2011-10-27 21:39:23 org.apache.catalina.core.StandardWrapperValve invoke
严重: Servlet.service() for servlet [spring3mvc] in context with path [/BBS] threw exception [Request method 'POST' not supported] with root cause
org.springframework.web.HttpRequestMethodNotSupportedException: Request method 'POST' not supported
Spring3MVC用Jquery的ajaxfileupload.js组件上传,死活找不到Controller,报告上面的错误!(FckEditor中添加插件)
@Controller
@RequestMapping("/fck")
public class FckImportWordController
{
@Autowired
SiteInfoDao siteInfoDao;
@RequestMapping(value = "/importWord.gp", method = RequestMethod.POST)
public void importWord(HttpServletRequest request, HttpServletResponse response, String filedata) throws IOException
{
}
}指定了请求方式。
html文件如下:<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<title>Code Properties</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta content="noindex, nofollow" name="robots">
<script type="text/javascript" src="jquery.min.js"></script>
<script type="text/javascript" src="ajaxfileupload.js"></script>
<script type="text/javascript" src="importword.js"></script>
</head>
<body scroll="no" style="OVERFLOW: hidden">
<table height="100%" width="95%" align="center">
<tr height="40">
<td>
<input type="file" name="filedata" id="filedata">
<input type="button" id="refer" value="导入" />
</td>
</tr>
</table>
</body>
</html>js代码如下:var oEditor = window.parent.InnerDialogLoaded();
var FCKLang = oEditor.FCKLang;
var FCKCodes = oEditor.FCKCodes;
oEditor.FCKLanguageManager.TranslatePage(document);
$(document).ready(function()
{
$("#refer").click(function()
{
alert("上传");
$.ajaxFileUpload(
{
url : "../fck/importWord.gp",
secureuri : false,
fileElementId : 'filedata',
dataType : 'text',
success : function(data, status)
{
if (typeof data != undefined)
{
if (data == "e")
{
alert("类型错误,只能是word类型的!");
}
else if(data == "kong")
{
alert("请选择Word文件!");
}
else
{
oEditor.FCK.InsertHtml(data);
window.parent.Cancel(true);
}
}
},
error : function(data, status, e)
{
alert("error" + status);
}
});
});
});请遇到类似问题的高手,帮我解决一下呀!谢谢!
严重: Servlet.service() for servlet [spring3mvc] in context with path [/BBS] threw exception [Request method 'POST' not supported] with root cause
org.springframework.web.HttpRequestMethodNotSupportedException: Request method 'POST' not supported
Spring3MVC用Jquery的ajaxfileupload.js组件上传,死活找不到Controller,报告上面的错误!(FckEditor中添加插件)
@Controller
@RequestMapping("/fck")
public class FckImportWordController
{
@Autowired
SiteInfoDao siteInfoDao;
@RequestMapping(value = "/importWord.gp", method = RequestMethod.POST)
public void importWord(HttpServletRequest request, HttpServletResponse response, String filedata) throws IOException
{
}
}指定了请求方式。
html文件如下:<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<title>Code Properties</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta content="noindex, nofollow" name="robots">
<script type="text/javascript" src="jquery.min.js"></script>
<script type="text/javascript" src="ajaxfileupload.js"></script>
<script type="text/javascript" src="importword.js"></script>
</head>
<body scroll="no" style="OVERFLOW: hidden">
<table height="100%" width="95%" align="center">
<tr height="40">
<td>
<input type="file" name="filedata" id="filedata">
<input type="button" id="refer" value="导入" />
</td>
</tr>
</table>
</body>
</html>js代码如下:var oEditor = window.parent.InnerDialogLoaded();
var FCKLang = oEditor.FCKLang;
var FCKCodes = oEditor.FCKCodes;
oEditor.FCKLanguageManager.TranslatePage(document);
$(document).ready(function()
{
$("#refer").click(function()
{
alert("上传");
$.ajaxFileUpload(
{
url : "../fck/importWord.gp",
secureuri : false,
fileElementId : 'filedata',
dataType : 'text',
success : function(data, status)
{
if (typeof data != undefined)
{
if (data == "e")
{
alert("类型错误,只能是word类型的!");
}
else if(data == "kong")
{
alert("请选择Word文件!");
}
else
{
oEditor.FCK.InsertHtml(data);
window.parent.Cancel(true);
}
}
},
error : function(data, status, e)
{
alert("error" + status);
}
});
});
});请遇到类似问题的高手,帮我解决一下呀!谢谢!
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货