类 InternalResourceViewResolver
- 所有已实现的接口:
cn.taketoday.beans.factory.Aware,cn.taketoday.context.ApplicationContextAware,cn.taketoday.core.Ordered,ViewResolver
UrlBasedViewResolver that supports
InternalResourceView (i.e. Servlets and JSPs) and subclasses
such as JstlView.
The view class for all views generated by this resolver can be specified
via UrlBasedViewResolver.setViewClass(java.lang.Class<?>). See UrlBasedViewResolver's javadoc for details.
The default is InternalResourceView, or JstlView if the
JSTL API is present.
BTW, it's good practice to put JSP files that just serve as views under WEB-INF, to hide them from direct access (e.g. via a manually entered URL). Only controllers will be able to access them then.
Note: When chaining ViewResolvers, an InternalResourceViewResolver always needs to be last, as it will attempt to resolve any view name, no matter whether the underlying resource actually exists.
-
嵌套类概要
从类继承的嵌套类/接口 cn.taketoday.web.view.AbstractCachingViewResolver
AbstractCachingViewResolver.CacheFilter -
字段概要
字段从类继承的字段 cn.taketoday.web.view.UrlBasedViewResolver
FORWARD_URL_PREFIX, REDIRECT_URL_PREFIX从类继承的字段 cn.taketoday.web.view.AbstractCachingViewResolver
DEFAULT_CACHE_FILTER, DEFAULT_CACHE_LIMIT, UNRESOLVED_VIEW从类继承的字段 cn.taketoday.context.support.ApplicationObjectSupport
applicationContext, log, messageSourceAccessor从接口继承的字段 cn.taketoday.core.Ordered
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE -
构造器概要
构造器构造器说明Sets the defaultview classtorequiredViewClass(): by defaultInternalResourceView, orJstlViewif the JSTL API is present.InternalResourceViewResolver(String prefix, String suffix) -
方法概要
修饰符和类型方法说明protected AbstractUrlBasedViewCreates a new View instance of the specified view class and configures it.protected AbstractUrlBasedViewInstantiate the specified view class.protected Class<?>Return the required type of view for this resolver.voidsetAlwaysInclude(boolean alwaysInclude) Specify whether to always include the view rather than forward to it.从类继承的方法 cn.taketoday.web.view.UrlBasedViewResolver
applyLifecycleMethods, canHandle, createView, getAttributesMap, getCacheKey, getContentType, getExposeContextBeansAsAttributes, getExposedContextBeanNames, getExposePathVariables, getOrder, getPrefix, getRequestContextAttribute, getSuffix, getViewClass, getViewNames, initApplicationContext, isRedirectContextRelative, isRedirectHttp10Compatible, loadView, setAttributes, setAttributesMap, setContentType, setExposeContextBeansAsAttributes, setExposedContextBeanNames, setExposeOutputRedirectModel, setExposePathVariables, setOrder, setPrefix, setRedirectContextRelative, setRedirectHttp10Compatible, setRequestContextAttribute, setSuffix, setViewClass, setViewNames从类继承的方法 cn.taketoday.web.view.AbstractCachingViewResolver
clearCache, getCacheFilter, getCacheLimit, isCache, isCacheUnresolved, removeFromCache, resolveViewName, setCache, setCacheFilter, setCacheLimit, setCacheUnresolved从类继承的方法 cn.taketoday.context.support.ApplicationObjectSupport
getApplicationContext, getMessageSourceAccessor, initApplicationContext, isContextRequired, obtainApplicationContext, requiredContextClass, setApplicationContext, unwrapContext, unwrapFactory
-
字段详细资料
-
jstlPresent
static final boolean jstlPresent -
alwaysInclude
-
-
构造器详细资料
-
InternalResourceViewResolver
public InternalResourceViewResolver()Sets the defaultview classtorequiredViewClass(): by defaultInternalResourceView, orJstlViewif the JSTL API is present. -
InternalResourceViewResolver
- 参数:
prefix- the prefix that gets prepended to view names when building a URLsuffix- the suffix that gets appended to view names when building a URL
-
-
方法详细资料
-
setAlwaysInclude
public void setAlwaysInclude(boolean alwaysInclude) Specify whether to always include the view rather than forward to it.Default is "false". Switch this flag on to enforce the use of a Servlet include, even if a forward would be possible.
-
requiredViewClass
从类复制的说明:UrlBasedViewResolverReturn the required type of view for this resolver. This implementation returnsAbstractUrlBasedView. -
instantiateView
从类复制的说明:UrlBasedViewResolverInstantiate the specified view class.The default implementation uses reflection to instantiate the class.
- 覆盖:
instantiateView在类中UrlBasedViewResolver- 返回:
- a new instance of the view class
- 另请参阅:
-
buildView
从类复制的说明:UrlBasedViewResolverCreates a new View instance of the specified view class and configures it. Does not perform any lookup for pre-defined View instances.Framework lifecycle methods as defined by the bean container do not have to be called here; those will be applied by the
loadViewmethod after this method returns.Subclasses will typically call
super.buildView(viewName)first, before setting further properties themselves.loadViewwill then apply Framework lifecycle methods at the end of this process.- 覆盖:
buildView在类中UrlBasedViewResolver- 参数:
viewName- the name of the view to build- 返回:
- the View instance
- 抛出:
Exception- if the view couldn't be resolved- 另请参阅:
-