获取项目根目录和tomcat路径时间:2025-04-28 07:52:26:///demo获取/demo ().getContextPath()或() 2.获取tomcat的路径 ().getRealPath("/")