本文整理汇总了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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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);
}
示例13: getKalturaDomainService
import org.springframework.web.context.WebApplicationContext; //导入方法依赖的package包/类
private static Object getKalturaDomainService(ServletContext servletContext) {
WebApplicationContext wac = WebApplicationContextUtils.getRequiredWebApplicationContext(servletContext);
return wac.getBean("kalturaService");
}
示例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();
}
}
示例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");
}