users@glassfish.java.net

Re: ScatteredAchive flattens metadata

From: Bhavanishankar <bhavanishankara.sapaliga_at_oracle.com>
Date: Mon, 06 Jun 2011 14:32:16 +0530

Sorry for the very late reply, as I missed this mail.

You can use the following method of the scatteredarchive
<http://embedded-glassfish.java.net/nonav/apidocs/org/glassfish/embeddable/archive/ScatteredArchive.html>:

public void*addMetadata*(java.io.File metadata, java.lang.String name)

In your case:

archive.addMetadata(new File("src/main/webapp",
"WEB-INF/tiles/tiles-def.xml"), "WEB-INF/tiles/tiles-def.xml");

Let me know if that does not wok.

Bhavani.

On 05/21/2011 09:26 PM, Mark Petrovic wrote:
> Hi.
>
> For embedded GF programming, I'm hoping there is a way to prevent a
> call such as this on a ScatteredArchive
>
> archive.addMetadata(new File("src/main/webapp", "WEB-INF/tiles/tiles-def.xml"));
>
> from flattening the full path to the tiles-def.xml file such that the
> resultant archive contains this
>
> WEB-INF/tiles-def.xml
>
> I'm trying to test a Struts app in a unit test that uses embedded GF
> as a servlet harness. And via web.xml config, Struts wants to find
> the tiles-def.xml descriptor in WEB-INF/tiles/tiles-def.xml.
>
> Any suggestions?
>
> Thanks.
>

-- 
Sun, an Oracle Company