Hi Farrukh,
Servlet and Static Handlers should be registered in Grizzly with proper
mapping, and most probably there is an issue.
If you register ServletHandler with some URI, say "/myservlet" - then
try to register static handler with "/myservlet/static" URI. In this
case all the requests to "/myservlet/static/..." will be redirected to
StaticHandler and other requests to "/myservlet/..." will be redirected
to ServletHandler.
Thanks.
WBR,
Alexey.
PS: you can create an issue and attach the testcase to it.
On 01/09/2012 06:09 PM, Farrukh Najmi wrote:
>
> Hi Alexey,
>
> Thank you for offering to help. Before I do the fair amount of work to
> create a standalone test case I thought to share observations below in
> case it helps identify my problem:
>
> * If I do not call "serverConfiguration.addHttpHandler" on my
> HttpServer's configuration then I can get dynamic resources served
> by my jersey rest endpoint. This is the base line that has worked
> for a long time before I had need for static resources to be
> served by same servlet as jersey endpoint
> * If I call "serverConfiguration.addHttpHandler" on my HttpServer then:
> o If I specify a context path for the StaticHttpHandler that is
> different from the context path for the ServletHandler for the
> SpringServlet for my jersey rest endpoint then I am able to
> get static resources served by the StaticHttpHandler. However,
> then I am no longer able to get dynamic resources served by my
> jersey rest endpoint.
> o If I specify a context path for the StaticHttpHandler that is
> same as the context path for the ServletHandler for the
> SpringServlet for my jersey rest endpoint then I am not able
> to get static resources served by the StaticHttpHandler nor am
> I able to get dynamic resources served by my jersey rest endpoint.
>
> See code fragment in my previous email for reference. It seems that if
> I include it my email gets tagged as spam.
>
> Can you give me a rough sketch of how I create my HttpServer such that:
>
> * The Grizzly2 server serves static resources (in my case javascript
> files) from some context path from my servlet
> * The Grizzly2 server serves dynamic HTML resources from my jersey
> rest endpoint that references the static javascript resources
> within <script> tags
> * The reference to static resources is relative to the dynamic
> resources rather than absolute
>
> Thanks for your help.
>
> --
> Regards,
> Farrukh Najmi
>
> Web:http://www.wellfleetsoftware.com
>