Hmm, I made an error in my earlier message. I was confusing the
"applicationContextPath" and the "rootPath". Everything I said refers to
the applicationContextPath, not the rootPath. So to fix that up:
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/<applicationContextPath>/index.html
http://example.com/<applicationContextPath>/assets/js/jquery.js
http://example.com/<applicationContextPath>/assets/img/logo.png
As for the option of swapping the static assets to "/" and moving the
Jersey servlet to the rootPath, as discussed at the DW docs link you
provided, it sounds like it should do what you want, but I have never tried
it. If it's not working for you then it's possible there is a regression in
DW, since it sounds like the sort of feature that might not be used very
widely.
Regards,
Doug
On Monday, July 10, 2017 at 12:50:54 PM UTC-4, Flavio Silveira wrote:
>
>
> 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
> <http://www.google.com/url?q=http%3A%2F%2Fwww.dropwizard.io%2F1.1.2%2Fdocs%2Fmanual%2Fcore.html%23serving-assets&sa=D&sntz=1&usg=AFQjCNHj_aWFFyMmMltC3tIdT-sVkcu_gA>
>
> 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.