Hello Andrew,
Thank you for your answer.
By sending file to a jsp, i wanted say uploading files. I set the enctype to "multipart/form-data" using javascript before i submit the form cause by default the enctype="application/x-www-form-urlencoded" and i can't use the enctype="application/x-www-form-urlencoded", cause to upload files, i have to parse the requste(in the jsp) using "upload.parseRequest(request)" (you can find the snippet below) and this function return this exception "org.apache.commons.fileupload.FileUploadBase$InvalidContentTypeException: the request doesn't contain a multipart/form-data or multipart/mixed stream, content type header is null" when enctype="multipart/form-data" are not equal to , the code work well before the integration on IM (using the task in jsp).
Yes we use the SiteMinder on the production environement but not in the developpement environement, actually we have this issue in the developpement environement.
My question is:
Is it impossible to use another enctype instead "application/x-www-form-urlencoded"?
FileItemFactory factory = new DiskFileItemFactory();
// Create a new file upload handler
ServletFileUpload upload = new ServletFileUpload(factory);
try {
// Here i get the exception
List items = upload.parseRequest(request);
Iterator iterator = items.iterator();
while (iterator.hasNext()) {
FileItem item = (FileItem) iterator.next();
if (!item.isFormField()) {
String fileName = item.getName();
String root = getServletContext().getRealPath("/");
File path = new File(root + "/uploads");
if (!path.exists()) {
boolean status = path.mkdirs();
}
File uploadedFile = new File(path + "/" + fileName);
System.out.println(uploadedFile.getAbsolutePath());
item.write(uploadedFile);
}
}
} catch (FileUploadException e) {
e.printStackTrace();
} catch (Exception e) {
e.printStackTrace();
}
Best regards.