On Tue, Feb 15, 2022 at 4:13 PM Feng Gao <gaofen...@hotmail.com> wrote:
> Hello! > Hello! > I followed instructions on https://tapestry.apache.org/css.html to change > Tapestry (v5.7.3) default stylesheet to use Bootstrap-4.6.1 stylesheet, > instead of the default Bootstrap-4.3.1: > > Here's what I ended up with in AppModule.java > @ImportModule(NoBootstrapModule.class) > public class AppModule > { > ........... > @ApplicationDefaults > @Contribute(SymbolProvider.class) > public static void setupEnvironment(final MappedConfiguration<String, > String> configuration) > { > .............. > configuration.add(SymbolConstants.DEFAULT_STYLESHEET, > "context:css/bootstrap-4.6.1-dist/css/bootstrap.css"); > } > } > I believe you're making a contribution to the wrong service: it should be to ApplicationDefaults directly, not to SymbolProvider. I suggest you try this: public static void contributeApplicationDefaults(final > MappedConfiguration<String, String> configuration) > { > .............. > configuration.add(SymbolConstants.DEFAULT_STYLESHEET, > "context:css/bootstrap-4.6.1-dist/css/bootstrap.css"); > } > } > Please let us know if it works. Also, I believe the approach suggested by Bob is the most recommended one, since you're just replacing the Bootstrap version. Using NoBootstrapModule is intended for when you're not using Bootstrap at all. -- Thiago