feat: support JXPathSpringGzipPacker

This commit is contained in:
ReaJason
2025-09-01 18:20:32 +08:00
parent 460cc9f2fa
commit 50459cff0d
21 changed files with 292 additions and 103 deletions
@@ -0,0 +1,20 @@
package com.reajason.javaweb.vul.springboot3.controller;
import org.apache.commons.jxpath.JXPathContext;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
/**
* @author ReaJason
* @since 2024/12/14
*/
@RestController
@RequestMapping("/jxpath")
public class JXPathController {
@PostMapping
protected Object doPost(String data) {
JXPathContext context = JXPathContext.newContext(null);
return context.getValue(data);
}
}
@@ -0,0 +1,25 @@
package com.reajason.javaweb.vul.springboot3.controller;
import ognl.Ognl;
import ognl.OgnlContext;
import ognl.OgnlException;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
/**
* @author ReaJason
* @since 2024/12/14
*/
@RestController
@RequestMapping("/ognl")
public class OgnlController {
@RequestMapping
protected Object doPost(String data) {
OgnlContext context = new OgnlContext();
try {
return Ognl.getValue(data, context, context.getRoot());
} catch (OgnlException e) {
throw new RuntimeException(e);
}
}
}