Class ViewServiceImpl

    • Method Detail

      • handleRequest

        public void handleRequest​(javax.servlet.http.HttpServletRequest req,
                                  javax.servlet.http.HttpServletResponse resp)
                           throws ViewException
        Description copied from interface: ViewService
        Handles a HTTP request. This method is usually invoked from a servlet.
        Specified by:
        handleRequest in interface ViewService
        Parameters:
        req - HttpServletRequest
        resp - HttpServletResponse
        Throws:
        ViewException - if the request could not be handled
      • invokeView

        public String invokeView​(String path)
                          throws ViewException
        Description copied from interface: ViewService
        Analyzes the given path, and invokes a view handler for processing the request.
        Specified by:
        invokeView in interface ViewService
        Parameters:
        path - the requested path
        Returns:
        String returned by the view handler, usually the name of a JSP template to forward the request to. May be null if the handler already took care for the response itself.
        Throws:
        PageNotFoundException - if no view was matching the given path
        ViewException - if the view handler could not be invoked or could not handle the request
      • buildPath

        public String buildPath​(PathContext data,
                                String view,
                                PathType type)
        Description copied from interface: ViewService
        Builds an URL path to a view that is able to render the provided data.
        Specified by:
        buildPath in interface ViewService
        Parameters:
        data - PathContext containing all the data for the path
        view - name of the view to build a path to
        type - PathType to be built
        Returns:
        the URL path that was built, or null if no view was found to be able to render the provided data
      • getTemplatePath

        public String getTemplatePath​(String template)
        Description copied from interface: ViewService
        Gets the path to a template resource with the given name. It is not checked if the template actually exists.
        Specified by:
        getTemplatePath in interface ViewService
        Parameters:
        template - Template name
        Returns:
        Template path
      • createEvaluationContext

        @Nonnull
        protected org.springframework.expression.EvaluationContext createEvaluationContext​(PathContext context)
        Creates an EvaluationContext to be used for evaluation in this view service. The default implementation creates a ViewPathEvaluationContext.
        Parameters:
        context - PathContext to be used as root object
        Returns:
        EvaluationContext to be used for evaluation