Skip to content

Instantly share code, notes, and snippets.

@chkal
Created April 1, 2015 15:39
Show Gist options
  • Save chkal/bbcb6e1f3d0a463da856 to your computer and use it in GitHub Desktop.
Save chkal/bbcb6e1f3d0a463da856 to your computer and use it in GitHub Desktop.
/**
* This will result in an additional ViewEngine. The priority ensures
* that this implementation is preferred.
*/
@Priority(1000)
public class AdditionalViewEngine extends FreemarkerViewEngine {
@Override
protected Configuration buildConfiguration() {
Configuration config = super.buildConfiguration();
// customize here
return config;
}
}
/**
* This ViewEngine implementation will replace the existing FreemarkerViewEngine.
*/
@Specializes
public class SpecializingViewEngine extends FreemarkerViewEngine {
@Override
protected Configuration buildConfiguration() {
Configuration config = super.buildConfiguration();
// customize here
return config;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment