segunda-feira, 10 de Julho de 2017 às 12:46:21 UTC-3, Douglas Patriarche 
escreveu:
>
> Hi Flavio,
>
> The "rootPath" is a global setting that affects all of Dropwizard's 
> underlying servlets. You can set the "rootPath" to whatever path you want 
> (e.g. "/api"), but then *all* resources will be under that rootPath, 
> including resources served by Jersey (like your index.html) and by the 
> AssetsBundle.
>
> It's common for people to want to set the AssetsBundle to serve from a 
> uriPath of "/" so that their static assets can be served from a path like 
> "/js". Unfortunately, the root path "/" is already claimed by the Jersey 
> servlet, so the AssetsBundle cannot also use it. It's a restriction of 
> Dropwizard that each AssetsBundle needs its own uriPath, since each is 
> built on its own servlet, and each servlet needs a unique URI path.
>
> So you're going to need to put your assets under some URI path, like 
> "assets":
>
>     bootstrap.addBundle(new AssetsBundle("/assets/", "/assets/", 
> "index.htm", "static"));
>
> Then your static assets will be served there:
>
>     http://example.com/rootPath/index.html
>     http://example.com/rootPath/assets/js/jquery.js
>     http://example.com/rootPath/assets/img/logo.png
>
> Regards,
> Doug
>

Hi Douglas,

Thanks for your quick reply!

Yes, that explains why I'm seeing the error, but I think the documentation 
on AssetsBundle should mention what you said about the rootPath "/" being 
already claimed by the Jersey servlet, the docs doesn't mention it from 
what I could understand here: 
 http://www.dropwizard.io/1.1.2/docs/manual/core.html#serving-assets

What do you think? 

-- 
You received this message because you are subscribed to the Google Groups 
"dropwizard-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to