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


Java HttpServlet.getServletContext方法代码示例

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


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

示例1: init

import javax.servlet.http.HttpServlet; //导入方法依赖的package包/类
@Override
public void init(HttpServlet servlet) throws Exception {
	TimeZone.setDefault(TimeZone.getTimeZone("Asia/Shanghai"));
	ServletContext servletContext = servlet.getServletContext();
	String configFileName = servletContext.getInitParameter("configFileName");
	Properties properties = loadConfig(configFileName);
	MybatisManager.init(properties.getProperty("config_dir"), "mybatis-config.xml", new MariadbLog());
	HttpUtil.init("UTF-8", new HttpclientLog());
	ThreadmsgLog threadmsgLog = new ThreadmsgLog();
	AsyncThreadManager.init(100, 10, 3, 0, threadmsgLog);
	AsyncThreadManager.start();
	MsgManager.init(true, threadmsgLog);
	CommonConfig.init(properties);
	HOpCode.init();

	MsgOpCode.init();
	HttpManager.addFilter(new TokenHttpFilter());
	HttpManager.addHttpListener(new AppService());
	HttpManager.addHttpListener(new OrderRecordService());
	HttpManager.addHttpListener(new PayService());
	HttpManager.addHttpListener(new LoginService());
	MsgManager.addMsgListener(new NotifyService(10));
}
 
开发者ID:dianbaer,项目名称:epay,代码行数:24,代码来源:Expand.java

示例2: init

import javax.servlet.http.HttpServlet; //导入方法依赖的package包/类
@Override
public void init(HttpServlet servlet) throws Exception {
	TimeZone.setDefault(TimeZone.getTimeZone("Asia/Shanghai"));
	ServletContext servletContext = servlet.getServletContext();
	String configFileName = servletContext.getInitParameter("configFileName");
	Properties properties = loadConfig(configFileName);
	MybatisManager.init(properties.getProperty("config_dir"), "mybatis-config.xml", new MariadbLog());
	KeyLockManager.init(new UCenterKeyLockType().getkeyLockType(), 120000, 100, new KeylockLog());
	HOpCodeUCenter.init();
	CommonConfigUCenter.init();
	CommonConfigUCenter.UCENTER_URL = properties.getProperty("uCenterUrl");
	HttpManager.addFilter(new TokenHttpFilter());
	HttpManager.addHttpListener(new UserService());
	HttpManager.addHttpListener(new UserGroupService());
	HttpManager.addHttpListener(new TokenService());
}
 
开发者ID:dianbaer,项目名称:startpoint,代码行数:17,代码来源:Expand.java

示例3: initPool

import javax.servlet.http.HttpServlet; //导入方法依赖的package包/类
static private void initPool() {
  if (log4j.isDebugEnabled())
    log4j.debug("init");
  try {
    HttpServlet srv = (HttpServlet) MessageContext.getCurrentContext().getProperty(
        HTTPConstants.MC_HTTP_SERVLET);
    ServletContext context = srv.getServletContext();
    pool = ConnectionProviderContextListener.getPool(context);
  } catch (Exception e) {
    log4j.error("Error : initPool");
    log4j.error(e.getStackTrace());
  }
}
 
开发者ID:mauyr,项目名称:openbravo-brazil,代码行数:14,代码来源:VersionUtility.java

示例4: getActivityContext

import javax.servlet.http.HttpServlet; //导入方法依赖的package包/类
/**
 * Find the standalone ActivityContext for this web aspectran service.
 *
 * @param servlet the servlet
 * @return the ActivityContext for this web aspectran service
 */
public static ActivityContext getActivityContext(HttpServlet servlet) {
    ServletContext servletContext = servlet.getServletContext();
    String attrName = STANDALONE_WEB_SERVICE_ATTRIBUTE_PREFIX + servlet.getServletName();
    ActivityContext activityContext = getActivityContext(servletContext, attrName);
    if (activityContext == null) {
        return getActivityContext(servletContext);
    }
    return activityContext;
}
 
开发者ID:aspectran,项目名称:aspectran,代码行数:16,代码来源:AspectranWebService.java

示例5: getCallingContext

import javax.servlet.http.HttpServlet; //导入方法依赖的package包/类
public static CallingContext getCallingContext(HttpServlet servlet, HttpServletRequest req) {
  return new CallingContextImpl(servlet.getServletContext(), req);
}
 
开发者ID:opendatakit,项目名称:aggregate,代码行数:4,代码来源:ContextFactory.java

示例6: okJsp

import javax.servlet.http.HttpServlet; //导入方法依赖的package包/类
default void okJsp(HttpServlet servlet, HttpServletRequest req, HttpServletResponse resp, String servletPath) throws IOException, ServletException {
    ServletContext servletContext = servlet.getServletContext();

    RequestDispatcher namedDispatcher = servletContext.getRequestDispatcher("/WEB-INF/jsp" + servletPath);

    namedDispatcher.forward(req, resp);
}
 
开发者ID:Prygan,项目名称:EventManager-JEE,代码行数:8,代码来源:HttpErrorResponse.java


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