dev@grizzly.java.net

Re: About static resource service without adapters in GWS

From: Jeanfrancois Arcand <Jeanfrancois.Arcand_at_Sun.COM>
Date: Mon, 08 Jun 2009 12:12:22 -0400

Salut,

Bongjae Chang wrote:
> Hi,
>
> I ran the GrizzlyWebServer very simply in grizzly-http-1.9.16.
>
> ---
> GrizzlyWebServer gws = new GrizzlyWebServer( port, webResourcesPath );
> try {
> gws.start();
> } catch( IOException e ) {
> ...
> }
> ---
>
> I didn't add any grizzly adapters in order to just test a static
> resource simply.
>
> But I found that it was not possible because of grizzly issue #614(
> https://grizzly.dev.java.net/issues/show_bug.cgi?id=614, "should be able
> to force adapterChains.setHandleStaticResources to false", rev.3216 ).
>
> See the current GrizzlyWebServer#updateGrizzlyAdapters().
>
> ---
> private void updateGrizzlyAdapters() {
> adapterChains = new GrizzlyAdapterChain();
> if( adapters.size() == 0 ) {
> adapterChains.setRootFolder(webResourcesPath);
> *adapterChains.setHandleStaticResources(false); // is it right?*
> grizzlyListener.setAdapter(adapterChains);
> } else {
> ...
> }
>
> }
> ---
>
> Maybe original above code is
> "adapterChains.setHandleStaticResources(true)" before rev.3216 if GWS
> doesn't have any adapters.
>
> Also, I think that Sebatien Dionne's proposed patch was
> "adapterChains.setHandleStaticResources(true)" if GWS had no adapers in
> issue #614.
>
> So, is it on purpose? And has the default policy for servicing a static
> resource without adapters been changed?
>
> I would like to know your opinions.

Good catch. Yes this is a regression. If there is no Adapter, we should
set that value to true. I will go ahead and fix that asap.

Thanks!

-- Jeanfrancois

>
> Thanks.
>
> --
> Bongjae Chang
>
>