当前位置: 首页>>代码示例>>Java>>正文


Java ServletRegistration.addMapping方法代码示例

本文整理汇总了Java中javax.servlet.ServletRegistration.addMapping方法的典型用法代码示例。如果您正苦于以下问题:Java ServletRegistration.addMapping方法的具体用法?Java ServletRegistration.addMapping怎么用?Java ServletRegistration.addMapping使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在javax.servlet.ServletRegistration的用法示例。


在下文中一共展示了ServletRegistration.addMapping方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: regiesterVIServlet

import javax.servlet.ServletRegistration; //导入方法依赖的package包/类
protected static final void regiesterVIServlet(ServletContext context,Logger logger){

        try {
            ServletRegistration.Dynamic asr = context.addServlet("VIApiServlet", VIApiServlet.class);

            if (asr != null) {
                asr.setLoadOnStartup(Integer.MAX_VALUE);
                asr.addMapping("/@in/api/*");
            } else {
                logger.warn("Servlet VIApiServlet already exists");
            }

            ServletRegistration ssr = context.addServlet("VIHttpServlet", StaticContentServlet.class);
            if (ssr != null) {
                ssr.addMapping("/@in/*");
            } else {
                logger.warn("Servlet VIHttpServlet already exists");
            }

        }catch (Throwable e){
            logger.error("VI register servlet failed",e);
        }
    }
 
开发者ID:ctripcorp,项目名称:cornerstone,代码行数:24,代码来源:ServletRegister.java

示例2: addEndpointMappingToCasServlet

import javax.servlet.ServletRegistration; //导入方法依赖的package包/类
/**
 * Add endpoint mapping to cas servlet.
 *
 * @param sce the sce
 * @param mapping the mapping
 */
protected final void addEndpointMappingToCasServlet(final ServletContextEvent sce, final String mapping) {
    logger.info("Adding [{}] to {} servlet context", mapping, WebUtils.CAS_SERVLET_NAME);
    final ServletRegistration registration = getCasServletRegistration(sce);
    if (registration != null) {

        registration.addMapping(mapping);
        logger.info("Added [{}] to {} servlet context", mapping, WebUtils.CAS_SERVLET_NAME);
    }
}
 
开发者ID:yuweijun,项目名称:cas-server-4.2.1,代码行数:16,代码来源:AbstractServletContextInitializer.java

示例3: init

import javax.servlet.ServletRegistration; //导入方法依赖的package包/类
@Override
public void init(ServletConfig config) throws ServletException {
    super.init(config);
    //初始化相关类
    HelperLoader.init();
    //获取ServletContext对象,注册Servlet
    ServletContext servletContext = config.getServletContext();
    //处理JSP的Servlet
    ServletRegistration jspServlet = servletContext.getServletRegistration("jsp");
    jspServlet.addMapping(ConfigHelper.getAppJspPath() + "*");
    //处理静态资源的默认Servlet
    ServletRegistration defaultServlet = servletContext.getServletRegistration("default");
    defaultServlet.addMapping(ConfigHelper.getAppAssetPath() + "*");
}
 
开发者ID:envyandgreed,项目名称:SmartFramework,代码行数:15,代码来源:DispatcherServlet.java

示例4: init

import javax.servlet.ServletRegistration; //导入方法依赖的package包/类
@Override
public void init(ServletConfig servletConfig) throws ServletException {
	// 初始化相关Helper类
	HelperLoader.init();
	// 获取ServletContext对象(用于注册Servlet)
	ServletContext servletContext = servletConfig.getServletContext();
	// 注册处理jsp的servlet
	ServletRegistration jspServlet = servletContext
			.getServletRegistration("jsp");
	jspServlet.addMapping(ConfigHelper.getAppJspPath() + "*");
	// 注册处理静态资源的默认Servlet
	ServletRegistration defaultServlet = servletContext
			.getServletRegistration("default");
	defaultServlet.addMapping(ConfigHelper.getAppAssetPath() + "*");
}
 
开发者ID:longjiazuo,项目名称:light-framework,代码行数:16,代码来源:DispatcherServlet.java

示例5: registerJspServlet

import javax.servlet.ServletRegistration; //导入方法依赖的package包/类
private void registerJspServlet(ServletContext context) {
    ServletRegistration servletRegistration = context.getServletRegistration("jsp");
    servletRegistration.addMapping("/index.jsp");
    String jspPath = PropertiesProvider.getString(FrameworkConstant.JSP_PATH);
    if (StringUtil.isNotEmpty(jspPath)) {
    	servletRegistration.addMapping(jspPath + "*");
    }
}
 
开发者ID:smxc,项目名称:garlicts,代码行数:9,代码来源:ContainerListener.java

示例6: registeJspServlet

import javax.servlet.ServletRegistration; //导入方法依赖的package包/类
/**
 * 添加jsp映射
 */
@Deprecated
private void registeJspServlet(ServletContext context) {
    ServletRegistration jspServlet = context.getServletRegistration("jsp");
    jspServlet.addMapping("/index.jsp");
    String jspPath = Constants.JSP_PATH_VALUE;
    jspServlet.addMapping(jspPath + "*");
}
 
开发者ID:huhuics,项目名称:tauren,代码行数:11,代码来源:Initializer.java

示例7: init

import javax.servlet.ServletRegistration; //导入方法依赖的package包/类
@Override
public void init(ServletConfig config) throws ServletException {
    Loader.init();//初始化框架&应用
    ServletContext sc = config.getServletContext();
    //注册JSP的Servlet
    ServletRegistration jspServlet = sc.getServletRegistration("jsp");
    jspServlet.addMapping(ConfigHelper.getAppJspPath() + "*");
    //注册处理静态资源的Servlet
    ServletRegistration defaultServlet = sc.getServletRegistration("default");
    defaultServlet.addMapping(ConfigHelper.getAppAssetPath() + "*");
}
 
开发者ID:CFshuming,项目名称:bfmvc,代码行数:12,代码来源:DispatherServlet.java


注:本文中的javax.servlet.ServletRegistration.addMapping方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。