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


Java WebApplicationContextUtils.getRequiredWebApplicationContext方法代码示例

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


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

示例1: init

import org.springframework.web.context.support.WebApplicationContextUtils; //导入方法依赖的package包/类
/**
    * Initialize the servlet.<br>
    * Retrieve from the servlet configuration the "baseDir" which is the root of the file repository:<br>
    * If not specified the value of "/UserFiles/" will be used.
    */
   @Override
   public void init() throws ServletException {
WebApplicationContext ctx = WebApplicationContextUtils
	.getRequiredWebApplicationContext(this.getServletContext());
messageService = (MessageService) ctx.getBean("centralMessageService");

LAMSConnectorServlet.baseDir = getInitParameter("baseDir");
debug = (new Boolean(getInitParameter("debug"))).booleanValue() && log.isDebugEnabled();

if (LAMSConnectorServlet.baseDir == null) {
    LAMSConnectorServlet.baseDir = "secure";
}

getConfigKeyValues();

File baseFile = new File(realBaseDir);
if (!baseFile.exists()) {
    baseFile.mkdir();
}
   }
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:26,代码来源:LAMSConnectorServlet.java

示例2: getService

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

示例3: getCommentService

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

示例4: getAuditService

import org.springframework.web.context.support.WebApplicationContextUtils; //导入方法依赖的package包/类
/**
    * Get AuditService bean.
    *
    * @return
    */
   private IAuditService getAuditService() {
if (MonitoringAction.auditService == null) {
    WebApplicationContext ctx = WebApplicationContextUtils
	    .getRequiredWebApplicationContext(getServlet().getServletContext());
    MonitoringAction.auditService = (IAuditService) ctx.getBean("auditService");
}
return MonitoringAction.auditService;
   }
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:14,代码来源:MonitoringAction.java

示例5: lookupPersistenceManagerFactory

import org.springframework.web.context.support.WebApplicationContextUtils; //导入方法依赖的package包/类
/**
 * Look up the PersistenceManagerFactory that this filter should use.
 * The default implementation looks for a bean with the specified name
 * in Spring's root application context.
 * @return the PersistenceManagerFactory to use
 * @see #getPersistenceManagerFactoryBeanName
 */
protected PersistenceManagerFactory lookupPersistenceManagerFactory() {
	if (logger.isDebugEnabled()) {
		logger.debug("Using PersistenceManagerFactory '" + getPersistenceManagerFactoryBeanName() +
				"' for OpenPersistenceManagerInViewFilter");
	}
	WebApplicationContext wac = WebApplicationContextUtils.getRequiredWebApplicationContext(getServletContext());
	return wac.getBean(getPersistenceManagerFactoryBeanName(), PersistenceManagerFactory.class);
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:16,代码来源:OpenPersistenceManagerInViewFilter.java

示例6: getUserManagementService

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

示例7: getMonitoringService

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

示例8: unspecified

import org.springframework.web.context.support.WebApplicationContextUtils; //导入方法依赖的package包/类
@Override
   public ActionForward unspecified(ActionMapping mapping, ActionForm form, HttpServletRequest request,
    HttpServletResponse response) throws Exception {
HttpSession ss = SessionManager.getSession();
UserDTO user = (UserDTO) ss.getAttribute(AttributeNames.USER);
long toolSessionId = WebUtil.readLongParam(request, AttributeNames.PARAM_TOOL_SESSION_ID);

WebApplicationContext wac = WebApplicationContextUtils
	.getRequiredWebApplicationContext(getServlet().getServletContext());
ILearnerService learnerService = (ILearnerService) wac.getBean("learnerService");
String finishURL = learnerService.completeToolSession(toolSessionId, user.getUserID().longValue());
return new RedirectingActionForward(finishURL);
   }
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:14,代码来源:LearningAction.java

示例9: getAuthoringService

import org.springframework.web.context.support.WebApplicationContextUtils; //导入方法依赖的package包/类
public IAuthoringService getAuthoringService() {
if (AuthoringAction.authoringService == null) {
    WebApplicationContext wac = WebApplicationContextUtils
	    .getRequiredWebApplicationContext(getServlet().getServletContext());
    AuthoringAction.authoringService = (IAuthoringService) wac
	    .getBean(AuthoringConstants.AUTHORING_SERVICE_BEAN_NAME);
}
return AuthoringAction.authoringService;
   }
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:10,代码来源:AuthoringAction.java

示例10: getGroupUserDAO

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

示例11: init

import org.springframework.web.context.support.WebApplicationContextUtils; //导入方法依赖的package包/类
@Override
   public void init() throws ServletException {
WebApplicationContext ctx = WebApplicationContextUtils.getRequiredWebApplicationContext(getServletContext());
auditService = (IAuditService) ctx.getBean("auditService");
lessonService = (ILessonService) ctx.getBean("lessonService");
gradebookService = (IGradebookService) ctx.getBean("gradebookService");
   }
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:8,代码来源:RecalculateTotalMarksForLessonServlet.java

示例12: getSecurityService

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

示例13: putActivityPositionInRequest

import org.springframework.web.context.support.WebApplicationContextUtils; //导入方法依赖的package包/类
/**
    * Finds activity position within Learning Design and stores it as request attribute.
    */
   public static ActivityPositionDTO putActivityPositionInRequest(Long activityId, HttpServletRequest request,
    ServletContext context) {
WebApplicationContext wac = WebApplicationContextUtils.getRequiredWebApplicationContext(context);
ILearnerService learnerService = (ILearnerService) wac.getBean("learnerService");
if (learnerService == null) {
    LearningWebUtil.log.warn("Can not set activity position, no Learner service in servlet context.");
    return null;
}
ActivityPositionDTO positionDTO = learnerService.getActivityPosition(activityId);
if (positionDTO != null) {
    request.setAttribute(AttributeNames.ATTR_ACTIVITY_POSITION, positionDTO);
}
return positionDTO;
   }
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:18,代码来源:LearningWebUtil.java

示例14: getMessageService

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

示例15: getService

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


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