Hi Jerome,
but if you hardcode this url ("war://......."), than you can't test
without package the files in a war, right?
best regards
Stephan
Jerome Louvel schrieb:
> Hi Charlie,
>
> For this, you will want to leverage the WAR client connector, see the
> ServerServlet Javadocs:
>
> "Also, a WAR client connector is automatically attached to the parent
> Restlet component. It lets you access to resources inside your WAR using the
> uniform interface. Here is an example of WAR URI that can be resolved by
> this client: "war:///WEB-INF/web.xml". In order to use it, just call the
> Context.getClientDispatcher() in your application."
>
> Best regards,
> Jerome Louvel
> --
> Restlet ~ Founder and Lead developer ~ http://www.restlet.org
> Noelios Technologies ~ Co-founder ~ http://www.noelios.com
>
>
> -----Message d'origine-----
> De : Charlie Lye [mailto:[email protected]]
> Envoyé : lundi 24 août 2009 18:11
> À : [email protected]
> Objet : Acessing static resources after deployment.
>
> Hi there,
>
> I've been using the following construct in order to make available static
> resources in the root of my exploded WAR.
>
> Directory dir = new Directory(getContext(),
> LocalReference.createFileReference(new File(".")));
> dir.setListingAllowed(true);
> router.attach(dir);
>
> This seems to work fine when testing before deployment, but once the WAR is
> packaged and deployed on Jetty, the relative file reference is pointing to
> root of the Jetty installation, and not to the root of the WAR file.
>
> Can someone advise me as to what I should be doing?
------------------------------------------------------
http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=2387010