<html>
<head><title>Absolute Path</title></head>
Absolute Path is:<%= getServletContext().getRealPath("/") %>
</html>
Run Code Online (Sandbox Code Playgroud)
希望这对你有所帮助
您可以使用真实路径。
String webRootPath = application.getRealPath("/").replace('\\', '/');
Run Code Online (Sandbox Code Playgroud)
或者
String webRootPath = getServletContext().getRealPath("/").replace('\\', '/');
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
35334 次 |
| 最近记录: |