Where is the “work” directory located for a Tomcat instance running in Eclipse?

前端 未结 7 902
隐瞒了意图╮
隐瞒了意图╮ 2021-01-31 03:42

In Eclipse you can configure numerous servers to run inside the IDE, including Tomcat. Depending on your Tomcat configuration, at some point in the life cycle of a webapp your J

7条回答
  •  面向向阳花
    2021-01-31 03:57

    The easiest way is most likely to ask a compiled JSP page about the source of the byte code.

    From http://www.exampledepot.com/egs/java.lang/ClassOrigin.html:

    // Get the location of this class
    Class cls = this.getClass();
    ProtectionDomain pDomain = cls.getProtectionDomain();
    CodeSource cSource = pDomain.getCodeSource();
    URL loc = cSource.getLocation();  // file:/c:/almanac14/examples/
    

    Hopefully this helps. What is it you want to do?

提交回复
热议问题