代码:
jsonObject.put("HttpTestController.class.getResource(\"\").toString()",HttpTestController.class.getResource("").toString());
jsonObject.put("HttpTestController.class.getResource(\"/\").toString()",HttpTestController.class.getResource("/").toString());
jsonObject.put("HttpTestController.class.getClassLoader().getResource(\"\")",HttpTestController.class.getClassLoader().getResource(""));
jsonObject.put("Thread.currentThread().getContextClassLoader().getResource(\"\").getPath()",Thread.currentThread().getContextClassLoader().getResource("").getPath());
jsonObject.put("request.getSession().getServletContext().getRealPath(\"\")",request.getSession().getServletContext().getRealPath(""));
jsonObject.put("request.getSession().getServletContext().getRealPath(\"/\")",request.getSession().getServletContext().getRealPath("/"));
windows下效果:
linux 下: