dev@grizzly.java.net

Re: Logging message being displayed about favico.ico not found in v3

From: Jeanfrancois Arcand <Jeanfrancois.Arcand_at_Sun.COM>
Date: Fri, 14 Mar 2008 10:11:33 -0400

Hi Pramod,

the solution will not works for v3 (see my reply on dev_at_glassfish). What
we need is a new setOutput404()/getOutput404() (better name?) with set
to true in Grizzly, and false in v3. What do you think?

Thanks!

-- Jeanfrancois

Pramod Gopinath wrote:
> Hi
> Code diffs for the favico.ico issue that I had run into 2 days back.
> Also saw this today on the dev_at_glassfish alias.
>
> Sending in the code diffs that I had used on my setup.
>
> Enjoy
> Pramod
>
> Index:
> modules/http-utils/src/main/java/com/sun/grizzly/tcp/StaticResourcesAdapter.java
>
> ===================================================================
> ---
> modules/http-utils/src/main/java/com/sun/grizzly/tcp/StaticResourcesAdapter.java
> (revision 889)
> +++
> modules/http-utils/src/main/java/com/sun/grizzly/tcp/StaticResourcesAdapter.java
> (working copy)
> @@ -99,8 +99,16 @@
> }
>
> if (!resource.exists()) {
> - logger.log(Level.INFO,"File not found " + resource);
> - res.setStatus(404);
> + if (resource.getName().equals("favicon.ico")) {
> + if (logger.isLoggable(Level.FINE)) {
> + logger.log(Level.FINE,"File not found " + resource);
> + }
> + } else {
> + if (logger.isLoggable(Level.INFO)) {
> + logger.log(Level.INFO,"File not found " + resource);
> + }
> + res.setStatus(404);
> + }
> return;
> } res.setStatus(200);
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe_at_grizzly.dev.java.net
> For additional commands, e-mail: dev-help_at_grizzly.dev.java.net
>