How to get a tomcat project path from different project in same tomcat by using java

前端 未结 1 957
孤城傲影
孤城傲影 2021-01-07 08:39

I am using this code to read a file in a tomcat project, called Project1 and now I want to get this path in different tomcat project, called Project2, using java.

         


        
相关标签:
1条回答
  • 2021-01-07 09:05
    • mark the context as crossContext=true in META-INF/context.xml
    • use getServletContext().getContext("/otherApp") to get an instance to the other app's `SetvletContext
    0 讨论(0)
提交回复
热议问题