Community
Participate
Working Groups
Use the following snippet in your code: ServletContext sc = RWT.getRequest().getSession().getServletContext(); System.out.println("<<<>>> RealPath /WEB-INF: " + sc.getRealPath("/WEB-INF")); System.out.println("<<<>>> RealPath /: " + sc.getRealPath("/")); Deploying a RAP application into a servlet container first using RAP 1.4 then using RAP 1.5: --> RAP 1.4 <<<>>> RealPath /WEB-INF: ...\tomcat\webapps\test14\WEB-INF <<<>>> RealPath /: ...\tomcat\webapps\test14\ --> RAP 1.5 M1 <<<>>> RealPath /WEB-INF: .../tomcat/work/Catalina/localhost/test15/eclipse/workspace/.metadata/.plugins/org.eclipse.rap.ui/context/WEB-INF <<<>>> RealPath /: .../tomcat/work/Catalina/localhost/test15/eclipse/workspace/.metadata/.plugins/org.eclipse.rap.ui/context/ RAP 1.5 should provide the same output as RAP 1.4... (By the way: should we add a new component in Bugzilla for RWT-OSGi integration bugs?)
Resolved in CVS-HEAD. ServletContextWrapper now uses the underlying getRealPath implementation if this does not return null. This is the case if RAP runs within a servlet container using the servlet bridge. Otherwise the wrapper returns the realpath calculation based on the local storage area of the RWTContext service. The latter is needed to keep the RWTConfigurationImpl working, which still is a remaining of the old W4Toolkit stuff - also it has been renamed and refactored several times. Maybe we will be able to remove this in the future as providing access to the web application's WEB-INF directories like classes and library IMHO should not be used by RWT. In particular as they do not exist in an OSGi standalone runtime.
*** Bug 356910 has been marked as a duplicate of this bug. ***