org.springframework.web.servlet.view.groovy

Class GroovyMarkupView

    • Constructor Detail

      • GroovyMarkupView

        public GroovyMarkupView()
    • Method Detail

      • setTemplateEngine

        public void setTemplateEngine(groovy.text.markup.MarkupTemplateEngine engine)
        Set the MarkupTemplateEngine to use in this view.

        If not set, the engine is auto-detected by looking up a single GroovyMarkupConfig bean in the web application context and using it to obtain the configured MarkupTemplateEngine instance.

        See Also:
        GroovyMarkupConfig
      • autodetectMarkupTemplateEngine

        protected groovy.text.markup.MarkupTemplateEngine autodetectMarkupTemplateEngine()
                                                                                  throws BeansException
        Autodetect a MarkupTemplateEngine via the ApplicationContext. Called if a MarkupTemplateEngine has not been manually configured.
        Throws:
        BeansException
      • checkResource

        public boolean checkResource(java.util.Locale locale)
                              throws java.lang.Exception
        Description copied from class: AbstractUrlBasedView
        Check whether the underlying resource that the configured URL points to actually exists.
        Overrides:
        checkResource in class AbstractUrlBasedView
        Parameters:
        locale - the desired Locale that we're looking for
        Returns:
        true if the resource exists (or is assumed to exist); false if we know that it does not exist
        Throws:
        java.lang.Exception - if the resource exists but is invalid (e.g. could not be parsed)
      • renderMergedTemplateModel

        protected void renderMergedTemplateModel(java.util.Map<java.lang.String,java.lang.Object> model,
                                                 HttpServletRequest request,
                                                 HttpServletResponse response)
                                          throws java.lang.Exception
        Description copied from class: AbstractTemplateView
        Subclasses must implement this method to actually render the view.
        Specified by:
        renderMergedTemplateModel in class AbstractTemplateView
        Parameters:
        model - combined output Map, with request attributes and session attributes merged into it if required
        request - current HTTP request
        response - current HTTP response
        Throws:
        java.lang.Exception - if rendering failed
      • getTemplate

        protected groovy.text.Template getTemplate(java.lang.String viewUrl)
                                            throws java.lang.Exception
        Return a template compiled by the configured Groovy Markup template engine for the given view URL.
        Throws:
        java.lang.Exception