Within my JSP page, I have used the following ajax call (valums-file-uploader) and the file is uploaded successfully. The JSF invokes the appropriate Servlet correctly. I am checking the uploaded file and doing Server Side validations within the Servlet. I am not sure how I can print the messages back to the same JSP's div. For example. If a field is empty, The file will not upload but I also want to display a custom message along with it. As of now I have stored the messages in the String format. I have the HttpServletResponse object but not sure how I can pass this custom String back to JSP page.
Thanks for any help or suggestions :)
new qq.FileUploader({
element: document.getElementById('file-uploader-demo1'),
allowedExtension: 'xls|xlsx',
action: '.....',
debug: true,
onSubmit : function(file, ext){
// change button text, when user selects file
},
onComplete: function(id, fileName, responseJSON){
if(!responseJSON.success)
{ //console.log (responseJSON.message);
showErrorBulkOrder();
}
else{
showSubmitBulkOrder();
}
}
});