|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.springframework.context.support.ApplicationObjectSupport org.springframework.web.context.support.WebApplicationObjectSupport org.springframework.web.servlet.view.AbstractCachingViewResolver org.springframework.web.servlet.view.ResourceBundleViewResolver
Implementation of ViewResolver that uses bean definitions in a ResourceBundle, specified by the bundle basename. The bundle is typically defined in a properties file, located in the classpath.
This ViewResolver supports internationalization, using the default support of java.util.PropertyResourceBundle.
Extends AbstractCachingViewResolver for decent performance.
ResourceBundle.getBundle(java.lang.String)
,
PropertyResourceBundle
Field Summary | |
static java.lang.String |
DEFAULT_BASENAME
Default if no other basename is supplied |
Fields inherited from class org.springframework.context.support.ApplicationObjectSupport |
logger |
Constructor Summary | |
ResourceBundleViewResolver()
|
Method Summary | |
protected BeanFactory |
initFactory(java.util.Locale locale)
Initialize the BeanFactory from the ResourceBundle, for the given locale. |
protected View |
loadView(java.lang.String viewName,
java.util.Locale locale)
Subclasses must implement this method. |
void |
setBasename(java.lang.String basename)
Set the basename, as defined in the java.util.ResourceBundle documentation. |
void |
setDefaultParentView(java.lang.String defaultParentView)
Set the default parent for views defined in the ResourceBundle. |
Methods inherited from class org.springframework.web.servlet.view.AbstractCachingViewResolver |
getCacheKey, isCache, resolveViewName, setCache |
Methods inherited from class org.springframework.web.context.support.WebApplicationObjectSupport |
getServletContext, getTempDir, getWebApplicationContext, requiredContextClass |
Methods inherited from class org.springframework.context.support.ApplicationObjectSupport |
getApplicationContext, getMessageSourceAccessor, initApplicationContext, setApplicationContext |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final java.lang.String DEFAULT_BASENAME
Constructor Detail |
public ResourceBundleViewResolver()
Method Detail |
public void setBasename(java.lang.String basename)
The default is "views".
basename
- the ResourceBundle base nameResourceBundle
public void setDefaultParentView(java.lang.String defaultParentView)
defaultParentView
- the default parent viewprotected View loadView(java.lang.String viewName, java.util.Locale locale) throws java.util.MissingResourceException, BeansException
AbstractCachingViewResolver
loadView
in class AbstractCachingViewResolver
viewName
- the name of the view to retrievelocale
- the Locale to retrieve the view for
java.util.MissingResourceException
BeansException
protected BeanFactory initFactory(java.util.Locale locale) throws java.util.MissingResourceException, BeansException
java.util.MissingResourceException
BeansException
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |