org.springframework.web.servlet.mvc.method.annotation

Class ModelAndViewMethodReturnValueHandler

  • java.lang.Object
    • org.springframework.web.servlet.mvc.method.annotation.ModelAndViewMethodReturnValueHandler
    • Constructor Detail

      • ModelAndViewMethodReturnValueHandler

        public ModelAndViewMethodReturnValueHandler()
    • Method Detail

      • setRedirectPatterns

        public void setRedirectPatterns(@Nullable
                                        java.lang.String... redirectPatterns)
        Configure one more simple patterns (as described in PatternMatchUtils.simpleMatch(java.lang.String, java.lang.String)) to use in order to recognize custom redirect prefixes in addition to "redirect:".

        Note that simply configuring this property will not make a custom redirect prefix work. There must be a custom View that recognizes the prefix as well.

        Since:
        4.1
      • getRedirectPatterns

        @Nullable
        public java.lang.String[] getRedirectPatterns()
        Return the configured redirect patterns, if any.
        Since:
        4.1
      • isRedirectViewName

        protected boolean isRedirectViewName(java.lang.String viewName)
        Whether the given view name is a redirect view reference. The default implementation checks the configured redirect patterns and also if the view name starts with the "redirect:" prefix.
        Parameters:
        viewName - the view name to check, never null
        Returns:
        "true" if the given view name is recognized as a redirect view reference; "false" otherwise.