Class AbstractUrlBasedView

    • Constructor Detail

      • AbstractUrlBasedView

        protected AbstractUrlBasedView()
        Constructor for use as a bean.
      • AbstractUrlBasedView

        protected AbstractUrlBasedView(java.lang.String url)
        Create a new AbstractUrlBasedView with the given URL.
        url - the URL to forward to
    • Method Detail

      • setUrl

        public void setUrl(@Nullable
                           java.lang.String url)
        Set the URL of the resource that this view wraps. The URL must be appropriate for the concrete View implementation.
      • getUrl

        public java.lang.String getUrl()
        Return the URL of the resource that this view wraps.
      • afterPropertiesSet

        public void afterPropertiesSet()
                                throws java.lang.Exception
        Description copied from interface: InitializingBean
        Invoked by the containing BeanFactory after it has set all bean properties and satisfied BeanFactoryAware, ApplicationContextAware etc.

        This method allows the bean instance to perform validation of its overall configuration and final initialization when all bean properties have been set.

        Specified by:
        afterPropertiesSet in interface InitializingBean
        java.lang.Exception - in the event of misconfiguration (such as failure to set an essential property) or if initialization fails for any other reason
      • isUrlRequired

        protected boolean isUrlRequired()
        Return whether the 'url' property is required.

        The default implementation returns true. This can be overridden in subclasses.

      • checkResource

        public boolean checkResource(java.util.Locale locale)
                              throws java.lang.Exception
        Check whether the underlying resource that the configured URL points to actually exists.
        locale - the desired Locale that we're looking for
        true if the resource exists (or is assumed to exist); false if we know that it does not exist
        java.lang.Exception - if the resource exists but is invalid (e.g. could not be parsed)