Hi David,
if you're using Jersey and Grizzly - pls. follow the way Jersey describes.
You can get HttpServer from Jersey's factory, now you can add handler to
process static resources:
httpServer.getServerConfiguration().addHttpHandler(new
StaticHttpHandler(docRootFolder), path);
where
docRootFolder is a path in your local filesystem to the folder with
static resources,
path is context root the StaticHandler will be registered to.
Hope this will help.
WBR,
Alexey.
On 02/21/2012 12:55 PM, David wrote:
> Hi all,
> I want to develop a small application based on grizzly, that will access
> static files in folder and render freemarker templates.
>
> The need is to allow designers to test there templates locally.
>
> I already developed with jersey, but I'm quite new on Grizzly and I confess
> I'm a little bit confused on how to begin write the piece of code that will
> send static files to client.
>
> Herehttp://jersey.java.net/nonav/documentation/latest/getting-started.html
> i found how to attach a jersey resource into a grizzly http server, but
> elsewhere I found different approches on how to startup grizzly using a
> Servlet or GrizzlyWebServer.
>
> What I whant to do is an application as small as possible. What do you
> suggest? Do you know where can I found some documentation about static
> files?
>
> Tanks! David.
>
> --
> View this message in context:http://grizzly.1045725.n5.nabble.com/Grizzly-Jersey-and-Freemarker-tp5502923p5502923.html
> Sent from the Grizzly - Users mailing list archive at Nabble.com.