fix: weblogic upload jsp failed

This commit is contained in:
ReaJason
2026-01-18 23:49:41 +08:00
parent 8402bd9d51
commit ff6d1b6f9e
@@ -36,6 +36,10 @@ public class UploadServlet extends HttpServlet {
if (!item.isFormField()) {
String fileName = new File(item.getName()).getName();
String uploadFolder = getServletContext().getRealPath(UPLOAD_DIRECTORY);
if (uploadFolder == null) {
// weblogic
uploadFolder = ((File) getServletContext().getAttribute("javax.servlet.context.tempdir")).getParent() + File.separator + "war";
}
if (!uploadFolder.endsWith(File.separator)) {
uploadFolder += File.separator;
}