Skip to content

Instantly share code, notes, and snippets.

@chkal
Created April 1, 2015 15:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • 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