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


Java WebApplicationContext.getBean方法代码示例

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


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

示例1: getUserService

import org.springframework.web.context.WebApplicationContext; //导入方法依赖的package包/类
private IUserManagementService getUserService() {
if (CommentAction.userService == null) {
    WebApplicationContext ctx = WebApplicationContextUtils
	    .getRequiredWebApplicationContext(getServlet().getServletContext());
    CommentAction.userService = (IUserManagementService) ctx.getBean("userManagementService");
}
return CommentAction.userService;
   }
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:9,代码来源:CommentAction.java

示例2: getSurveyService

import org.springframework.web.context.WebApplicationContext; //导入方法依赖的package包/类
private ISurveyService getSurveyService() {
if (ChartAction.surveyService == null) {
    WebApplicationContext wac = WebApplicationContextUtils
	    .getRequiredWebApplicationContext(getServlet().getServletContext());
    ChartAction.surveyService = (ISurveyService) wac.getBean(SurveyConstants.SURVEY_SERVICE);
}
return ChartAction.surveyService;
   }
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:9,代码来源:ChartAction.java

示例3: getUserService

import org.springframework.web.context.WebApplicationContext; //导入方法依赖的package包/类
private IUserManagementService getUserService() {
if (RedirectAction.userService == null) {
    WebApplicationContext ctx = WebApplicationContextUtils
	    .getRequiredWebApplicationContext(getServlet().getServletContext());
    RedirectAction.userService = (IUserManagementService) ctx.getBean("userManagementService");
}
return RedirectAction.userService;
   }
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:9,代码来源:RedirectAction.java

示例4: getEventNotificationService

import org.springframework.web.context.WebApplicationContext; //导入方法依赖的package包/类
private IEventNotificationService getEventNotificationService() {
if (NotificationAction.eventNotificationService == null) {
    WebApplicationContext ctx = WebApplicationContextUtils
	    .getRequiredWebApplicationContext(getServlet().getServletContext());
    NotificationAction.eventNotificationService = (IEventNotificationService) ctx
	    .getBean("eventNotificationService");
}
return NotificationAction.eventNotificationService;
   }
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:10,代码来源:NotificationAction.java

示例5: getService

import org.springframework.web.context.WebApplicationContext; //导入方法依赖的package包/类
private static IUserManagementService getService() {
if (LanguageUtil.service == null) {
    WebApplicationContext ctx = WebApplicationContextUtils
	    .getWebApplicationContext(SessionManager.getServletContext());
    LanguageUtil.service = (IUserManagementService) ctx.getBean("userManagementService");
}
return LanguageUtil.service;
   }
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:9,代码来源:LanguageUtil.java

示例6: getMessageService

import org.springframework.web.context.WebApplicationContext; //导入方法依赖的package包/类
private MessageService getMessageService() {
if (EmailUserAction.messageService == null) {
    WebApplicationContext ctx = WebApplicationContextUtils
	    .getRequiredWebApplicationContext(getServlet().getServletContext());
    EmailUserAction.messageService = (MessageService) ctx
	    .getBean(CentralConstants.CENTRAL_MESSAGE_SERVICE_BEAN_NAME);

}
return EmailUserAction.messageService;
   }
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:11,代码来源:EmailUserAction.java

示例7: getSecurityService

import org.springframework.web.context.WebApplicationContext; //导入方法依赖的package包/类
private ISecurityService getSecurityService() {
if (DisplayGroupAction.securityService == null) {
    WebApplicationContext ctx = WebApplicationContextUtils
	    .getRequiredWebApplicationContext(getServlet().getServletContext());
    DisplayGroupAction.securityService = (ISecurityService) ctx.getBean("securityService");
}
return DisplayGroupAction.securityService;
   }
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:9,代码来源:DisplayGroupAction.java

示例8: getSecurityService

import org.springframework.web.context.WebApplicationContext; //导入方法依赖的package包/类
private ISecurityService getSecurityService() {
if (securityService == null) {
    WebApplicationContext ctx = WebApplicationContextUtils
	    .getRequiredWebApplicationContext(getServlet().getServletContext());
    securityService = (ISecurityService) ctx.getBean("securityService");
}
return securityService;
   }
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:9,代码来源:PortraitBatchUploadAction.java

示例9: getLearnerService

import org.springframework.web.context.WebApplicationContext; //导入方法依赖的package包/类
private ICoreLearnerService getLearnerService() {
if (GradebookService.learnerService == null) {
    WebApplicationContext ctx = WebApplicationContextUtils
	    .getWebApplicationContext(SessionManager.getServletContext());
    GradebookService.learnerService = (ICoreLearnerService) ctx.getBean("learnerService");
}
return GradebookService.learnerService;
   }
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:9,代码来源:GradebookService.java

示例10: getGradebookService

import org.springframework.web.context.WebApplicationContext; //导入方法依赖的package包/类
private IGradebookService getGradebookService() {
if (GradebookAction.gradebookService == null) {
    WebApplicationContext ctx = WebApplicationContextUtils
	    .getRequiredWebApplicationContext(getServlet().getServletContext());
    GradebookAction.gradebookService = (IGradebookService) ctx.getBean("gradebookService");
}
return GradebookAction.gradebookService;
   }
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:9,代码来源:GradebookAction.java

示例11: getLearningDesignService

import org.springframework.web.context.WebApplicationContext; //导入方法依赖的package包/类
private ILearningDesignService getLearningDesignService() {
if (AuthoringAction.learningDesignService == null) {
    WebApplicationContext ctx = WebApplicationContextUtils
	    .getRequiredWebApplicationContext(getServlet().getServletContext());
    AuthoringAction.learningDesignService = (ILearningDesignService) ctx.getBean("learningDesignService");
}
return AuthoringAction.learningDesignService;
   }
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:9,代码来源:AuthoringAction.java

示例12: getCommonCartridgeService

import org.springframework.web.context.WebApplicationContext; //导入方法依赖的package包/类
private ICommonCartridgeService getCommonCartridgeService() {
WebApplicationContext wac = WebApplicationContextUtils
	.getRequiredWebApplicationContext(getServlet().getServletContext());
return (ICommonCartridgeService) wac.getBean(CommonCartridgeConstants.RESOURCE_SERVICE);
   }
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:6,代码来源:ViewItemAction.java

示例13: getKalturaDomainService

import org.springframework.web.context.WebApplicationContext; //导入方法依赖的package包/类
private static Object getKalturaDomainService(ServletContext servletContext) {
WebApplicationContext wac = WebApplicationContextUtils.getRequiredWebApplicationContext(servletContext);
return wac.getBean("kalturaService");
   }
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:5,代码来源:KalturaServiceProxy.java

示例14: initializeRootNode

import org.springframework.web.context.WebApplicationContext; //导入方法依赖的package包/类
/**
 * @param storeValue String
 * @param rootPath String
 * @param context WebApplicationContext
 * @param nodeService NodeService
 * @param searchService SearchService
 * @param namespaceService NamespaceService
 * @param tenantService TenantService
 * @param m_transactionService TransactionService
 */
private void initializeRootNode(String storeValue, String rootPath, WebApplicationContext context, NodeService nodeService, SearchService searchService,
        NamespaceService namespaceService, TenantService tenantService, TransactionService m_transactionService)
{

    // Use the system user as the authenticated context for the filesystem initialization

    AuthenticationContext authComponent = (AuthenticationContext) context.getBean("authenticationContext");
    authComponent.setSystemUserAsCurrentUser();

    // Wrap the initialization in a transaction

    UserTransaction tx = m_transactionService.getUserTransaction(true);

    try
    {
        // Start the transaction

        if (tx != null)
            tx.begin();
        
        StoreRef storeRef = new StoreRef(storeValue);
        
        if (nodeService.exists(storeRef) == false)
        {
            throw new RuntimeException("No store for path: " + storeRef);
        }
        
        NodeRef storeRootNodeRef = nodeService.getRootNode(storeRef);
        
        List<NodeRef> nodeRefs = searchService.selectNodes(storeRootNodeRef, rootPath, null, namespaceService, false);
        
        if (nodeRefs.size() > 1)
        {
            throw new RuntimeException("Multiple possible children for : \n" + "   path: " + rootPath + "\n" + "   results: " + nodeRefs);
        }
        else if (nodeRefs.size() == 0)
        {
            throw new RuntimeException("Node is not found for : \n" + "   root path: " + rootPath);
        }
        
        defaultRootNode = nodeRefs.get(0);
        
        // Commit the transaction
        if (tx != null)
        	tx.commit();
    }
    catch (Exception ex)
    {
        logger.error(ex);
    }
    finally
    {
        // Clear the current system user

        authComponent.clearCurrentSecurityContext();
    }
}
 
开发者ID:Alfresco,项目名称:alfresco-remote-api,代码行数:68,代码来源:WebDAVServlet.java

示例15: getActivityMapping

import org.springframework.web.context.WebApplicationContext; //导入方法依赖的package包/类
/**
    * Get the ActionMappings.
    */
   public static ActivityMapping getActivityMapping(ServletContext context) {
WebApplicationContext wac = WebApplicationContextUtils.getRequiredWebApplicationContext(context);
return (ActivityMapping) wac.getBean("activityMapping");
   }
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:8,代码来源:LearningWebUtil.java


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