Dropwizard: Unable To Serve Static Html
I'm currently working on serving a static html page in Dropwizard at the root path '/'. So far, I've only received an error page stating 'HTTP ERROR 404 Problem accessing /. Reaso
Solution 1:
After couple of modifications to your code, got it to working condition.
AssetBundle path is calculated from project resources folder. Therefore add path relative to that. Here
assets
directory is located in${Project Root}/src/main/resources
directorybootstrap.addBundle(newAssetsBundle("/assets/", "/"));
Remove explicit Jersey registry entry. I believe this is inherited from configuration.
environment.jersey().setUrlPattern("/*"); /*this line should be removed*/
You will need to included dropwizard-assets
to your project's dependencies.
For reference, just created a sample project with static assets.
Post a Comment for "Dropwizard: Unable To Serve Static Html"