我有一个用Spring构建的应用程序。在JSP中,我已经集成了Dropzone用于图像上传。
<form:form modelAttribute="services" method="POST" id="service" enctype="multipart/form-data" cssClass="dropzone">
<form:input path="budget">
<form:textarea path="informationToBuyer" cssClass="summernote"/>
<div id="dropzone" class="col-md-8"></div>
<form:form>
在上面的代码预算中绑定了spring modelAttribute并且infoToBuyer没有绑定。
但是当我删除summernote css时,它就会被绑定。
我的JS for Dropzone如下。
Dropzone.options.service = {
// The configuration we've talked about above
autoProcessQueue : false,
uploadMultiple : true,
maxFilesize : 256,
parallelUploads : 50,
maxFiles : 50,
addRemoveLinks : true,
clickable : true,
previewsContainer : "#dropzone",
// The setting up of the dropzone
init : function() {
var myDropzone = this;
// First change the button to actually tell Dropzone to process the queue.
this.element.querySelector("button[type=submit]")
.addEventListener("click", function(e) {
// Make sure that the form isn't actually being sent.
e.preventDefault();
e.stopPropagation();
myDropzone.processQueue();
});
// Listen to the sendingmultiple event. In this case, it's the sendingmultiple event instead
// of the sending event because uploadMultiple is set to true.
this.on("sendingmultiple", function() {
// Gets triggered when the form is actually being sent.
// Hide the success button or the complete form.
myDropzone.processQueue();
});
this.on("successmultiple", function(files, response) {
window.location.replace(response.redirect);
exit();
});
this.on("errormultiple", function(files, response) {
});
}
};
请告诉我为什么WYSIWYG编辑器不使用Dropzone表单。