根据jsp, servlet, 普通类,可以把获得web工程的路径方法分为3种

1.jsp
<%=application.getRealPath("") %>
<%=request.getRealPath("") %>

2.servlet(当然包括了action等,只要能获得servlet)

  servletContext.getRealPath("");

3.普通类

  System.getProperty("user.dir")

相关文章:

  • 2022-01-14
  • 2021-12-19
  • 2021-07-09
  • 2022-12-23
  • 2021-12-09
  • 2021-07-03
  • 2021-09-27
猜你喜欢
  • 2022-12-23
  • 2021-06-06
  • 2021-12-19
  • 2021-11-30
相关资源
相似解决方案