gpt4 book ai didi

org.directwebremoting.WebContext.getServletContext()方法的使用及代码示例

转载 作者:知者 更新时间:2024-03-22 13:31:05 27 4
gpt4 key购买 nike

本文整理了Java中org.directwebremoting.WebContext.getServletContext()方法的一些代码示例,展示了WebContext.getServletContext()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。WebContext.getServletContext()方法的具体详情如下:
包路径:org.directwebremoting.WebContext
类名称:WebContext
方法名:getServletContext

WebContext.getServletContext介绍

暂无

代码示例

代码示例来源:origin: org.directwebremoting/dwr

public Object doFilter(Object object, Method method, Object[] params, AjaxFilterChain chain) throws Exception
{
  ServletContext context = WebContextFactory.get().getServletContext();
  SessionFactory sessionFactory = (SessionFactory) context.getAttribute(ATTRIBUTE_SESSION);
  Transaction transaction = null;
  if (sessionFactory != null)
  {
    Session session = sessionFactory.getCurrentSession();
    transaction = session.beginTransaction();
  }
  else
  {
    log.error("SessionFactory not initialized for this web application. Use: H3SessionAjaxFilter.setSessionFactory(servletContext, sessionFactory);");
  }
  Object reply = chain.doFilter(object, method, params);
  if (transaction != null)
  {
    transaction.commit();
  }
  return reply;
}

代码示例来源:origin: org.directwebremoting/dwr

public void destroy()
{
  WebContext webcx = WebContextFactory.get();
  for(Creator c : creators.values()) {
    if (c.getScope().equals(Creator.APPLICATION)) {
      Object creatorInstance = webcx.getServletContext().getAttribute(c.getJavascript());
      if (creatorInstance instanceof UninitializingBean) {
        ((UninitializingBean) creatorInstance).destroy();
      }
    }
  }
}

代码示例来源:origin: org.directwebremoting/dwr

ServletContext sc = WebContextFactory.get().getServletContext();
try

代码示例来源:origin: org.directwebremoting/dwr

ServletContext threadServletContext = webContext.getServletContext();
welcomeFiles = getWebXmlWelcomeFileList(threadServletContext);

代码示例来源:origin: org.directwebremoting/dwr

public Object convertInbound(Class<?> paramType, InboundVariable data)
{
  WebContext webcx = WebContextFactory.get();
  if (HttpServletRequest.class.isAssignableFrom(paramType))
  {
    return webcx.getHttpServletRequest();
  }
  if (HttpServletResponse.class.isAssignableFrom(paramType))
  {
    return webcx.getHttpServletResponse();
  }
  if (ServletConfig.class.isAssignableFrom(paramType))
  {
    return webcx.getServletConfig();
  }
  if (ServletContext.class.isAssignableFrom(paramType))
  {
    return webcx.getServletContext();
  }
  if (HttpSession.class.isAssignableFrom(paramType))
  {
    return webcx.getSession(true);
  }
  return null;
}

代码示例来源:origin: infiniteautomation/ma-core-public

public Object doFilter(Object obj, Method method, Object[] params, AjaxFilterChain chain) throws Exception {
    WebContext webContext = WebContextFactory.get();

    if (resourceBundleDirectory != null && resourceBundleLoader == null)
      resourceBundleLoader = new ResourceBundleLoader(webContext.getServletContext().getRealPath(
          resourceBundleDirectory));

    I18NUtils.prepareRequest(webContext.getHttpServletRequest(), localeResolverName, bundleBaseName,
        resourceBundleLoader);
    return chain.doFilter(obj, method, params);
  }
}

代码示例来源:origin: infiniteautomation/ma-core-public

public Object doFilter(Object obj, Method method, Object[] params, AjaxFilterChain chain) throws Exception {
    WebContext webContext = WebContextFactory.get();

    WebApplicationContext wac = WebApplicationContextUtils.getRequiredWebApplicationContext(webContext
        .getServletContext());
    MessageSource messageSource = (MessageSource) wac.getBean(messageSourceKey);

    JstlUtils.exposeLocalizationContext(webContext.getHttpServletRequest(), messageSource);

    return chain.doFilter(obj, method, params);
  }
}

代码示例来源:origin: vivo-project/Vitro

public EntityDWR(){
  WebContext ctx = WebContextFactory.get();
  ServletContext sc= ctx.getServletContext();
  entityWADao =  ModelAccess.on(sc).getWebappDaoFactory().getIndividualDao();
}

代码示例来源:origin: org.directwebremoting/dwr

String moduleName = (String) getModuleNameMethod.invoke(utils, "/", wc.getServletContext());
  moduleConfig = (ModuleConfig) getModuleConfigMethod.invoke(utils, moduleName, wc.getServletContext());
moduleConfig = RequestUtils.getModuleConfig(request, wc.getServletContext());

代码示例来源:origin: org.directwebremoting/dwr

object = webcx.getServletContext().getAttribute(name);
  webcx.getServletContext().setAttribute(name, object);

代码示例来源:origin: org.directwebremoting/dwr

if (webcx != null)
  return webcx.getServletContext();

代码示例来源:origin: org.directwebremoting/dwr

ServletContext context = WebContextFactory.get().getServletContext();
Session session = H3SessionAjaxFilter.getCurrentSession(context);

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com