Java Spring文件上载内部服务器错误

Java Spring文件上载内部服务器错误,java,spring,spring-mvc,file-upload,Java,Spring,Spring Mvc,File Upload,我正在尝试使用SpringMVC上传一个文件。我的表格: <form enctype="multipart/form-data"> Name: <input type="text" name=name><br> Email ID: <input type="email" name=emailID><br> Attachment: <input type="file" name=

我正在尝试使用SpringMVC上传一个文件。我的表格:

    <form enctype="multipart/form-data">
       Name: <input type="text" name=name><br> 
       Email ID: <input type="email" name=emailID><br> 
       Attachment: <input type="file" name=file id="file"><br> 
       Submit?: <input type="submit" name=submit value="Done"><br>
    </form>

名称:
电子邮件ID:
附件:
提交?:
我得到一个内部服务器错误

错误是:

1) 505错误

2) 没有堆栈跟踪


表单将自行重置,而不是转到下一页,即通知页。

为了安全起见,在进行上载时,您应始终使用POST或PUT,否则您将继续进行,因为此时仅支持ASCII

<form enctype="multipart/form-data" method="POST">

您能显示异常堆栈跟踪吗?实际错误是什么?“内部服务器错误”表示服务器端代码中出现故障。什么失败了?就是这样,没有堆栈跟踪。它说内部服务器错误505
@RequestMapping(value = "/add", params = "submit", method = RequestMethod.POST)
public ModelAndView addForm(@ModelAttribute PostModel newPost){
    System.out.println("Added " + newPost.getQuestion() + " successfully");
    System.out.println("Added the file " + file.getName() + "successfully");
    return addController.showNotice(newPost.getQuestion());
}