diff --git a/src/com/hellogithub/servlet/UploadHandleServlet.java b/src/com/hellogithub/servlet/UploadHandleServlet.java index 36aca46..c787777 100644 --- a/src/com/hellogithub/servlet/UploadHandleServlet.java +++ b/src/com/hellogithub/servlet/UploadHandleServlet.java @@ -39,7 +39,7 @@ public class UploadHandleServlet extends HttpServlet { //得到上传文件的保存目录,将上传的文件存放于WEB-INF目录下,不允许外界直接访问,保证上传文件的安全 String savePath = this.getServletContext().getRealPath(File.separator+"WEB-INF"+File.separator+"upload"); - savePath= this.getServletContext().getRealPath(File.separator+"WEB-INF"+File.separator+"upload").replace("\\out\\artifacts\\hellogithub_war_exploded\\WEB-INF\\upload","\\web\\uploadFile"); + savePath= this.getServletContext().getRealPath(File.separator+"WEB-INF"+File.separator+"upload").replace("\\out\\artifacts\\helloGithub_war_exploded\\WEB-INF\\upload","\\web\\uploadFile"); System.out.println(savePath); // savePath="D:\\Java\\helloG\\hellogithub\\web\\uploadFile"; // String savePath="E:\\Desktop\\out"; diff --git a/src/com/hellogithub/servlet/userAvatarServlet.java b/src/com/hellogithub/servlet/userAvatarServlet.java index 4e02f95..8deed76 100644 --- a/src/com/hellogithub/servlet/userAvatarServlet.java +++ b/src/com/hellogithub/servlet/userAvatarServlet.java @@ -3,11 +3,11 @@ package com.hellogithub.servlet; import com.alibaba.fastjson.JSONObject; import com.hellogithub.entity.userEntity; import com.hellogithub.service.UserService; -import jakarta.servlet.ServletException; -import jakarta.servlet.http.HttpServlet; -import jakarta.servlet.http.HttpServletRequest; -import jakarta.servlet.http.HttpServletResponse; -import jakarta.servlet.http.HttpSession; +import javax.servlet.ServletException; +import javax.servlet.http.HttpServlet; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import javax.servlet.http.HttpSession; import javax.servlet.annotation.WebServlet; import java.io.IOException; diff --git a/web/WEB-INF/web.xml b/web/WEB-INF/web.xml index d80081d..a1c8489 100644 --- a/web/WEB-INF/web.xml +++ b/web/WEB-INF/web.xml @@ -3,4 +3,13 @@ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-app_4_0.xsd" version="4.0"> + + + default + *.jpg + *.css + *.png + *.gif + *.js + \ No newline at end of file