Operating environment: Jdk1.7+tomcat7+groupdocs-annotation-2.0.0
Note: examples are groupdocs-annotation java-2.0.0 version encountered the following two questions, please help to solve it
- When Upload the Chinese name of the file ,displayed Garbled
attachment(1)
// UploadFileServlet.java
String uploadFileName;
uploadFileName = request.getParameter("fileName");
File tempFile = File.createTempFile("annotation-upload", "_" + uploadFileName);
FileOutputStream outputStream = null;
InputStream uploadInputStream = null;
try {
outputStream = new FileOutputStream(tempFile);
uploadInputStream = new FileInputStream(tempFile);
IOUtils.copy(request.getInputStream(), outputStream);
writeOutput(MediaType.APPLICATION_JSON, response,
annotationHandler.uploadFileHandler(uploadFileName, uploadInputStream));
} catch (AnnotationException e) {
Logger.getLogger(this.getClass().getName())
.log(Level.SEVERE, MESSAGE_HANDLER_THROWS, e.getMessage());
writeOutput(MediaType.APPLICATION_JSON, response,
toJson(new StatusResult(false, e.getMessage())));
}
- IE10 compatibility view and IE7, IE8 initialization page display error
attachment(2)
critical code
// IndexServlet.java
request.setAttribute("annotation_scripts",
annotationHandler.getAnnotationScript(initialPath, userName, userGuid));
RequestDispatcher requestDispatcher = request.getRequestDispatcher("annotation/index.jsp");
requestDispatcher.forward(request, response);