Interface FreemarkerProcessingService
-
- All Known Implementing Classes:
FreemarkerProcessingServiceImpl
public interface FreemarkerProcessingServiceProvide the ability to process a Freemarker template outside of the context of a FreemarkerHttpServlet. The most likely place to use this is when rendering a short view that was invoked through an AJAX call.
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static classFreemarkerProcessingService.TemplateParsingExceptionTemplate parser detected a problem.static classFreemarkerProcessingService.TemplateProcessingExceptionIndicates a failure to render the given template with the given data.
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description booleanisTemplateAvailable(String templateName, javax.servlet.http.HttpServletRequest req)Is there an accessible template by this name? The question is asked in the context of the current request, which determines the theme directory.StringrenderTemplate(String templateName, Map<String,Object> map, javax.servlet.http.HttpServletRequest req)Process a Freemarker template with a data map, producing string of HTML.
-
-
-
Method Detail
-
isTemplateAvailable
boolean isTemplateAvailable(String templateName, javax.servlet.http.HttpServletRequest req) throws FreemarkerProcessingService.TemplateProcessingException
Is there an accessible template by this name? The question is asked in the context of the current request, which determines the theme directory.- Throws:
FreemarkerProcessingService.TemplateProcessingException- If the template is found, but cannot be parsed.
-
renderTemplate
String renderTemplate(String templateName, Map<String,Object> map, javax.servlet.http.HttpServletRequest req) throws FreemarkerProcessingService.TemplateProcessingException
Process a Freemarker template with a data map, producing string of HTML. This is done in the context of the current HttpServletRequest, which provides a wide range of ancillary information, including (but not limited to) theme directory, context path, info on logged-in user, authorizations for the current user, etc., etc.
-
-