Author: manaRH
Date: 2010-06-14 06:14:23 -0400 (Mon, 14 Jun 2010)
New Revision: 13134
Modified:
branches/enterprise/JBPAPP_5_0/src/main/org/jboss/seam/mock/MockServletContext.java
Log:
JBPAPP-4273 - getting real webappRoot from container
Modified:
branches/enterprise/JBPAPP_5_0/src/main/org/jboss/seam/mock/MockServletContext.java
===================================================================
---
branches/enterprise/JBPAPP_5_0/src/main/org/jboss/seam/mock/MockServletContext.java 2010-06-13
22:06:15 UTC (rev 13133)
+++
branches/enterprise/JBPAPP_5_0/src/main/org/jboss/seam/mock/MockServletContext.java 2010-06-14
10:14:23 UTC (rev 13134)
@@ -56,7 +56,11 @@
}
else
{
- webappRoot = new File(getClass().getResource("/.").toURI());
+ // in case of web application in real servlet container
+ // expected path
/jboss-as/server/<profile>/deploy/<war>/WEB-INF/lib/jboss-seam.jar/org/jboss/seam/mock/
+ String pathToPackage = getClass().getResource("").getPath();
+ String[] paths = pathToPackage.split("WEB-INF");
+ webappRoot = new File(paths[0]);
}
}
catch (URISyntaxException e)
Show replies by date