public final class WebMVC extends Object implements IModule, IWebMvc
MODULE_NAME| Constructor and Description |
|---|
WebMVC() |
WebMVC(IWebMvcConfig config) |
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
static IWebMvc |
get() |
IWebMvcConfig |
getConfig()
获取WebMVC模块配置对象
|
String |
getName()
获取模块名称
|
IApplication |
getOwner()
获取所属应用容器实例
|
void |
initialize(IApplication owner)
初始化
|
boolean |
isInitialized()
是否已初始化
|
void |
processRequest(IRequestContext context,
ServletContext servletContext,
HttpServletRequest request,
HttpServletResponse response)
处理控制器请求
|
boolean |
registerController(Class<?> targetClass)
注册并分析控制器
|
boolean |
registerController(String requestMappingPrefix,
Class<?> targetClass)
注册并分析控制器
|
boolean |
registerInterceptorRule(Class<? extends IInterceptorRule> targetClass)
注册拦截器规则配置
|
public WebMVC()
public WebMVC(IWebMvcConfig config)
public static IWebMvc get()
public void initialize(IApplication owner) throws Exception
IInitializationinitialize in interface IInitialization<IApplication>owner - 指定所属容器参数对象Exception - 初始过程中产生的任何异常public boolean isInitialized()
IInitializationisInitialized in interface IInitialization<IApplication>public void close()
throws Exception
close in interface AutoCloseableExceptionpublic IWebMvcConfig getConfig()
IWebMvcpublic IApplication getOwner()
IWebMvcpublic boolean registerController(Class<?> targetClass) throws Exception
IWebMvcregisterController in interface IWebMvctargetClass - 目标类型Exception - 可能产生的异常public boolean registerController(String requestMappingPrefix, Class<?> targetClass) throws Exception
IWebMvcregisterController in interface IWebMvcrequestMappingPrefix - 请求路径映射前缀targetClass - 目标类型Exception - 可能产生的异常public boolean registerInterceptorRule(Class<? extends IInterceptorRule> targetClass) throws Exception
IWebMvcregisterInterceptorRule in interface IWebMvctargetClass - 目标类型Exception - 可能产生的异常public void processRequest(IRequestContext context, ServletContext servletContext, HttpServletRequest request, HttpServletResponse response) throws Exception
IWebMvcprocessRequest in interface IWebMvccontext - 请求上下文servletContext - ServletContext对象request - HttpServletRequest对象response - HttpServletResponse对象Exception - 可能产生的异常Copyright © 2022. All rights reserved.