Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Multiple AssetsBundle #499

Closed
Toilal opened this issue Mar 19, 2014 · 3 comments
Closed

Multiple AssetsBundle #499

Toilal opened this issue Mar 19, 2014 · 3 comments

Comments

@Toilal
Copy link
Contributor

Toilal commented Mar 19, 2014

When defining multiple asset bundles, only the last one is working.

@Override
public void initialize(Bootstrap<RegistrationWebUIConfiguration> bootstrap) {
    bootstrap.addBundle(new AssetsBundle("/assets/css", "/css"));
    bootstrap.addBundle(new AssetsBundle("/assets/fonts", "/fonts"));
    bootstrap.addBundle(new AssetsBundle("/assets/js", "/js"));

    bootstrap.addBundle(new ViewBundle());
}

In this case, only /js is accessible.

A simple workaround is to give a different assetsName in the AssetsBundle constructor.

@Override
public void initialize(Bootstrap<RegistrationWebUIConfiguration> bootstrap) {
    bootstrap.addBundle(new AssetsBundle("/assets/css", "/css", null, "css"));
    bootstrap.addBundle(new AssetsBundle("/assets/js", "/js", null, "js"));
    bootstrap.addBundle(new AssetsBundle("/assets/fonts", "/fonts", null, "fonts"));

    bootstrap.addBundle(new ViewBundle());
}

Dropwizard should take care of this by default ... Or at least display a warning message at init time.

@frodereinertsen
Copy link

@mveitas
Copy link
Contributor

mveitas commented Mar 29, 2014

@Toilal
The AssetBundle could take care of this by default, but you would loose the ability to be able to add a servlet filter to the asset bundle.

I think there just needs to be some better docs regarding this.

@Toilal
Copy link
Contributor Author

Toilal commented May 30, 2014

I close this issue, as a warning message is now displayed. Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants