class BaseResource extends ServerResource {
    @Override
    public EngineApplication getApplication() {
        return (EngineApplication) super.getApplication();
    }

    protected Engine getEngine() {
        return getApplication().getEngine();
    }

    protected String getStaticRef(String resource) {
        String rootRef = getRequest().getRootRef().toString();
        return rootRef + "/engine/static/" + resource;
    }

    protected Representation render(String templateName, ViewModel viewModel) {
        return render(templateName, viewModel, null);
    }

    protected Representation render(String templateName, ViewModel viewModel, ObjectWrapper objectWrapper) {
        String baseRef = getRequest().getResourceRef().getBaseRef().toString();
        if(!baseRef.endsWith("/")) {
            baseRef += "/";
        }
        viewModel.put("baseRef", baseRef);
        viewModel.setFlashes(Flash.getFlashes(getRequest()));

        Template template;
        try {
            template = getApplication().getTemplateConfiguration().getTemplate(templateName);
        } catch (IOException e) {
            throw new UncheckedIOException("Error reading template " + templateName, e);
        }

        return new WriterRepresentation(MediaType.TEXT_HTML) {
            @Override
            public void write(Writer writer) throws IOException {<FILL_FUNCTION_BODY>}
        };
    }
}

                try {
                    template.process(viewModel, writer, objectWrapper);
                } catch (TemplateException e) {
                    throw new RuntimeException(e);
                }
                writer.flush();
            
<no_super_class>