Class AbstractUrlBasedView
java.lang.Object
org.springframework.web.reactive.result.view.AbstractView
org.springframework.web.reactive.result.view.AbstractUrlBasedView
- All Implemented Interfaces:
- Aware,- BeanNameAware,- InitializingBean,- ApplicationContextAware,- View
- Direct Known Subclasses:
- FreeMarkerView,- RedirectView,- ScriptTemplateView
Abstract base class for URL-based views. Provides a consistent way of
 holding the URL that a View wraps, in the form of a "url" bean property.
- Since:
- 5.0
- Author:
- Rossen Stoyanchev
- 
Field SummaryFields inherited from class org.springframework.web.reactive.result.view.AbstractViewlogger, REQUEST_DATA_VALUE_PROCESSOR_BEAN_NAMEFields inherited from interface org.springframework.web.reactive.result.view.ViewBINDING_CONTEXT_ATTRIBUTE
- 
Constructor SummaryConstructorsModifierConstructorDescriptionprotectedConstructor for use as a bean.protectedCreate a new AbstractUrlBasedView with the given URL.
- 
Method SummaryModifier and TypeMethodDescriptionvoidInvoked by the containingBeanFactoryafter it has set all bean properties and satisfiedBeanFactoryAware,ApplicationContextAwareetc.abstract booleancheckResourceExists(Locale locale) Check whether the resource for the configured URL actually exists.getUrl()Return the URL of the resource that this view wraps.reactor.core.publisher.Mono<Boolean>resourceExists(Locale locale) Deferred check whether the resource for the configured URL actually exists.voidSet the URL of the resource that this view wraps.toString()Methods inherited from class org.springframework.web.reactive.result.view.AbstractViewcreateRequestContext, formatViewName, getApplicationContext, getBeanName, getDefaultCharset, getModelAttributes, getRequestContextAttribute, getRequestDataValueProcessor, getSupportedMediaTypes, obtainApplicationContext, render, renderInternal, resolveAsyncAttributes, setApplicationContext, setBeanName, setDefaultCharset, setRequestContextAttribute, setSupportedMediaTypesMethods inherited from class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.springframework.web.reactive.result.view.ViewisRedirectView
- 
Constructor Details- 
AbstractUrlBasedViewprotected AbstractUrlBasedView()Constructor for use as a bean.
- 
AbstractUrlBasedViewCreate a new AbstractUrlBasedView with the given URL.
 
- 
- 
Method Details- 
setUrlSet the URL of the resource that this view wraps. The URL must be appropriate for the concrete View implementation.
- 
getUrlReturn the URL of the resource that this view wraps.
- 
afterPropertiesSetDescription copied from interface:InitializingBeanInvoked by the containingBeanFactoryafter it has set all bean properties and satisfiedBeanFactoryAware,ApplicationContextAwareetc.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:
- afterPropertiesSetin interface- InitializingBean
- Throws:
- Exception- in the event of misconfiguration (such as failure to set an essential property) or if initialization fails for any other reason
 
- 
checkResourceExistsCheck whether the resource for the configured URL actually exists.- Parameters:
- locale- the desired Locale that we're looking for
- Returns:
- falseif the resource exists- falseif we know that it does not exist
- Throws:
- Exception- if the resource exists but is invalid (e.g. could not be parsed)
 
- 
resourceExistsDeferred check whether the resource for the configured URL actually exists.The default implementation calls checkResourceExists(Locale).- Parameters:
- locale- the desired Locale that we're looking for
- Returns:
- falseif the resource exists- falseif we know that it does not exist
- Since:
- 6.1
 
- 
toString- Overrides:
- toStringin class- AbstractView
 
 
-