mirror of
https://github.com/ReaJason/MemShellParty.git
synced 2026-09-22 07:00:43 +08:00
feat: support jetty shell generate
This commit is contained in:
@@ -0,0 +1,22 @@
|
||||
import javax.servlet.ServletException;
|
||||
import javax.servlet.http.HttpServlet;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.io.IOException;
|
||||
|
||||
/**
|
||||
* @author ReaJason
|
||||
* @since 2024/12/7
|
||||
*/
|
||||
public class TestServlet extends HttpServlet {
|
||||
|
||||
@Override
|
||||
protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
|
||||
|
||||
}
|
||||
}
|
||||
@@ -35,7 +35,7 @@ public class UploadServlet extends HttpServlet {
|
||||
for (FileItem item : items) {
|
||||
if (!item.isFormField()) {
|
||||
String fileName = new File(item.getName()).getName();
|
||||
String uploadPath = getServletContext().getRealPath(UPLOAD_DIRECTORY) + fileName;
|
||||
String uploadPath = getServletContext().getRealPath(UPLOAD_DIRECTORY) + File.separator + fileName;
|
||||
File uploadFile = new File(uploadPath);
|
||||
item.write(uploadFile);
|
||||
response.getWriter().println("file upload success: " + uploadPath);
|
||||
|
||||
Reference in New Issue
Block a user