當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。