类 ViewControllerRegistry
- 所有已实现的接口:
cn.taketoday.beans.factory.Aware,cn.taketoday.context.ApplicationContextAware
- 从以下版本开始:
- 4.0 2022/2/18 22:20
- 作者:
- Rossen Stoyanchev, Keith Donald, Harry Yang
-
字段概要
字段修饰符和类型字段说明static final StringThe resoure's content typestatic final Stringstatic final Stringresource location @since 2.3.7static final Stringstatic final StringThe response status @since 2.3.7static final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringprotected cn.taketoday.beans.factory.config.EmbeddedValueResolverprivate intprivate final List<RedirectViewControllerRegistration>private final List<ViewControllerRegistration>static final Stringstatic final String从类继承的字段 cn.taketoday.context.support.ApplicationObjectSupport
applicationContext, log, messageSourceAccessor -
构造器概要
构造器构造器说明ViewControllerRegistry(cn.taketoday.context.ApplicationContext applicationContext) Class constructor withApplicationContext. -
方法概要
修饰符和类型方法说明addRedirectViewController(String pathPattern, String redirectUrl) Map a view controller to the given URL path or pattern in order to redirect to another URL.voidaddStatusController(String pathPattern, HttpStatusCode statusCode) Map a simple controller to the given URL path (or pattern) in order to set the response status to the given code without rendering a body.voidaddStatusController(String pathPattern, Integer status) Map a simple controller to the given URL path (or pattern) in order to set the response status to the given code without rendering a body.addViewController(String pathPattern) Map a URL path or pattern to a view controller to render a response with the configured status code and view.addViewController(String pathPattern, Object resource) Map a view controller to the given URL path (or pattern) in order to render a response with a pre-configured status code and view.protected SimpleUrlHandlerMappingReturn theHandlerMappingthat contains the registered view controller mappings, ornullfor no registrations.protected voidconfigController(Element controller) Start configurationprotected voidconfigure(cn.taketoday.core.io.Resource resource) configure from a xml fileprotected voidprocessAction(String prefix, String suffix, Element action) voidMap a URL path or pattern to a view controller to render a response with the configured status code and view.voidregisterWebViewXml(cn.taketoday.core.io.Resource resource) protected StringresolveEmbeddedVariables(String expression) voidsetOrder(int order) Specify the order to use for theHandlerMappingused to map view controllers relative to other handler mappings configured in Framework MVC.从类继承的方法 cn.taketoday.context.support.ApplicationObjectSupport
getApplicationContext, getMessageSourceAccessor, initApplicationContext, initApplicationContext, isContextRequired, obtainApplicationContext, requiredContextClass, setApplicationContext, unwrapContext, unwrapFactory
-
字段详细资料
-
webMvcConfigLocation
- 另请参阅:
-
DTD_NAME
- 另请参阅:
-
ATTR_RESOURCE
- 另请参阅:
-
ATTR_NAME
- 另请参阅:
-
ATTR_PREFIX
resource location @since 2.3.7- 另请参阅:
-
ATTR_SUFFIX
- 另请参阅:
-
ATTR_CONTENT_TYPE
The resoure's content type- 从以下版本开始:
- 2.3.3
- 另请参阅:
-
ATTR_TYPE
- 另请参阅:
-
ATTR_STATUS
The response status @since 2.3.7- 另请参阅:
-
ELEMENT_ACTION
- 另请参阅:
-
ELEMENT_CONTROLLER
- 另请参阅:
-
ROOT_ELEMENT
- 另请参阅:
-
registrations
-
redirectRegistrations
-
order
private int order -
embeddedValueResolver
protected cn.taketoday.beans.factory.config.EmbeddedValueResolver embeddedValueResolver
-
-
构造器详细资料
-
ViewControllerRegistry
public ViewControllerRegistry(cn.taketoday.context.ApplicationContext applicationContext) Class constructor withApplicationContext.
-
-
方法详细资料
-
addViewController
Map a URL path or pattern to a view controller to render a response with the configured status code and view.Patterns such as
"/admin/**"or"/articles/{articlename:\\w+}"are supported.Note: If an
@RequestMappingmethod is mapped to a URL for any HTTP method then a view controller cannot handle the same URL. For this reason it is recommended to avoid splitting URL handling across an annotated controller and a view controller. -
addViewController
Map a view controller to the given URL path (or pattern) in order to render a response with a pre-configured status code and view.Patterns like
"/articles/**"or"/articles/{id:\\w+}"are allowed. SeeAntPathMatcherfor more details on the syntax.- 参数:
pathPattern- Patterns like"/articles/**"or"/articles/{id:\\w+}"are allowed. SeeAntPathMatcherfor more details on the syntax.resource- resource location,such as redirect url or view template resource Or other type of resource
-
addRedirectViewController
public RedirectViewControllerRegistration addRedirectViewController(String pathPattern, String redirectUrl) Map a view controller to the given URL path or pattern in order to redirect to another URL.By default the redirect URL is expected to be relative to the current ServletContext, i.e. as relative to the web application root.
-
addStatusController
Map a simple controller to the given URL path (or pattern) in order to set the response status to the given code without rendering a body. -
addStatusController
Map a simple controller to the given URL path (or pattern) in order to set the response status to the given code without rendering a body. -
registerWebViewXml
public void registerWebViewXml()Map a URL path or pattern to a view controller to render a response with the configured status code and view.Patterns such as
"/admin/**"or"/articles/{articlename:\\w+}"are supported.Note: If an
@RequestMappingmethod is mapped to a URL for any HTTP method then a view controller cannot handle the same URL. For this reason it is recommended to avoid splitting URL handling across an annotated controller and a view controller. -
registerWebViewXml
public void registerWebViewXml(cn.taketoday.core.io.Resource resource) -
setOrder
public void setOrder(int order) Specify the order to use for theHandlerMappingused to map view controllers relative to other handler mappings configured in Framework MVC.By default this is set to 1, i.e. right after annotated controllers, which are ordered at 0.
-
buildHandlerMapping
Return theHandlerMappingthat contains the registered view controller mappings, ornullfor no registrations. -
configure
configure from a xml file- 抛出:
Exception- 另请参阅:
-
StringUtils.split(String)StringUtils.isSplitable(char)
-
configController
Start configuration- 参数:
controller- the controller element- 从以下版本开始:
- 2.3.7
-
processAction
-
resolveEmbeddedVariables
- 从以下版本开始:
- 3.0.3
-