users@grizzly.java.net

Re: StaticHttpHandler

From: Oleksiy Stashok <oleksiy.stashok_at_oracle.com>
Date: Tue, 06 Mar 2012 18:54:24 +0100

Hi Yves,

can you pls. try to use the attached version of StaticHttpHandler, if it
works fine for you - can I ask you to file the issue and we'll include
the fix into next Grizzly versions.

Thanks.

WBR,
Alexey.

PS: if you use Grizzly version 2.2.x - you'll see compilation error, so
pls. change
         final NIOOutputStream outputStream = response.getOutputStream();

to

         final NIOOutputStream outputStream = response.getNIOOutputStream();


On 03/06/2012 05:24 PM, Yves Gaffinet wrote:
> Dear all
>
> I'm new with the grizzly framework but I already realize some small
> "helloworlds"
>
> But I have a problem with the StaticHttpHandler.
>
> When I try to serve some static files, I get this exception:
> org.glassfish.grizzly.PendingWriteQueueLimitExceededException: Max
> queued data limit exceeded: 32879>32768
>
> This is how i use the handler:
>
> server.getServerConfiguration().addHttpHandler(new
> StaticHttpHandler("C:\\maps"), "/map");
>
> Thanks for your help
>
> Yves
>