Pages

Monday, March 5, 2012

Location of compiled jsp source file

The location:
workspaces\.metadata\.plugins\org.eclipse.wst.server.core\tmp0\work\Catalina\localhost\your app

OR


You can ask a compiled JSP page about the source of the code.

// 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/

No comments:

Post a Comment