Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [m2e-users] Dev build of m2e-wtp 0.13.1 available for testing

Klaus,

Rafal's suggestion makes sense. But should you continue on your current path, then I believe you'll be interested to follow https://issues.sonatype.org/browse/MECLIPSEWTP-136 (Option in the workspace preferences as to the location of the generated manifest for wars). Add yourself to the watch list, you'll be notified when the feature is available to test.

Regards,

Fred Bricon

2011/7/8 Rafał Krzewski <Rafal.Krzewski@xxxxxxxxx>
ServletContext.getRealPath(String) is generally not portable and not reliable method of accessing the contents of the web application. For example when running from a non-expanded war this method returns null for all paths. On the other hand, ServletContext.getResource(String) should work irregardless of particular application server and deployment method.

cheers,
Rafał


On 07/08/2011 09:24 AM, Klaus Reimer wrote:
On 07/07/2011 07:17 PM, Fred Bricon wrote:
Please give this dev build a try so we can definitely release 0.13.1
ASAP and reinstate m2e-wtp in the m2e marketplace.
I have a serious problem with it. An existing web application of mine
uses code like this to access some files in the WEB-INF directory (WAR
is always deployed exploded):

File webInfDir = servlet.getServletContext().getRealPath("WEB-INF");

With the old m2e-wtp getRealpath returned the web root directory from
the eclipse project where the real files are located. But now it returns
the target/m2e-wtp/web-resources directory which is always empty. So my
web project can't access the files in the web root.

Is there a known workaround? If not then I have to add some java code to
the web project so it detects the m2e-wtp deployment and auto-corrects
the path.


_______________________________________________
m2e-users mailing list
m2e-users@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/m2e-users



--
"Have you tried turning it off and on again" - The IT Crowd

Back to the top