refactor: change vul modules structure

This commit is contained in:
ReaJason
2024-12-22 10:42:48 +08:00
parent 0fea777294
commit 91181ffc55
32 changed files with 9 additions and 12 deletions
@@ -0,0 +1,28 @@
import ognl.Ognl;
import ognl.OgnlContext;
import ognl.OgnlException;
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/14
*/
public class OgnlServlet extends HttpServlet {
@Override
protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
String data = req.getParameter("data");
OgnlContext context = new OgnlContext();
Object value = null;
try {
value = Ognl.getValue(data, context, context.getRoot());
} catch (OgnlException e) {
throw new RuntimeException(e);
}
resp.getWriter().println(value);
}
}