Skip to content

How to configure Rocker to use GuavaHtmlStringify? #169

@franz1981

Description

@franz1981

I cannot find how to configure the template engine to use GuavaHtmlStringify instead of the default one for the DefaultRockerTemplate.__internal if not by manually allocating the view and override DefaultRockerTemplate buildTemplate() to create a custom one (manually crafted) like this

    private static final DefaultHtmlStringify STRINGIFY = new GuavaHtmlStringify();

    private static class CustomFortunesTemplate extends Fortunes.Template {

        public CustomFortunesTemplate(Fortunes model) {
            super(model);
            // super would set contentType HTML and force `DefaultHtmlStringify` :"(
            __internal.setStringify(STRINGIFY);
        }
    }

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions