users@grizzly.java.net

Re: how handle static content with GrizzlyWebServer ?

From: Jeanfrancois Arcand <Jeanfrancois.Arcand_at_Sun.COM>
Date: Mon, 09 Feb 2009 17:07:36 -0500

Salut,

Survivant 00 wrote:
> I started Hudson with GrizzlyWebServer but when I access the root page,
> I don,t see images or css.

The application is under /hudson. I guess we can improve the error page
here, but I suspect you got a 404, which is expected.

>
> I saw some examples where you put
> ServerAdapter.setHandleStaticResources(true)..
>
> 2 Questions
>
> # 1 - but when you have multiples servlets how you do that ?

They all needs to be under their own path, e.g. you can invoke the
following method to differentiate them:

https://grizzly.dev.java.net/nonav/apidocs/com/sun/grizzly/tcp/StaticResourcesAdapter.html#setResourcesContextPath(java.lang.String)


>
> # 2 - there is a way to set the handle on the GrizzyWebServer instead ?

Can you elaborate?

Thanks

-- Jeanfrancois



>
>