add caching (untested)

This commit is contained in:
ayunami2000
2022-04-17 19:21:44 -04:00
parent 01d2cf44ea
commit b6b5a7f227
11 changed files with 132 additions and 25 deletions
@@ -46,7 +46,7 @@ public class AbstractServlet extends HttpServlet
public void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException
{
String ipAddress = req.getRemoteAddr();
if (ipAddress == null)
if (ipAddress.equals("127.0.0.1"))
{
ipAddress = req.getHeader("X-FORWARDED-FOR");
}
@@ -72,8 +72,8 @@ public class AbstractServlet extends HttpServlet
resp.setStatus(HttpServletResponse.SC_OK);
try
{
Object object = mapping.method.invoke(this, req);
resp.getWriter().println(object.toString());
Object object = mapping.method.invoke(this, req, resp);
if (object != null) resp.getWriter().println(object.toString());
}
catch (IOException | IllegalAccessException | InvocationTargetException e)
{