本文整理汇总了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();
}
}
示例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;
}
示例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;
}
示例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;
}
示例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);
}
示例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;
}
示例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;
}
示例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);
}
示例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;
}
示例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;
}
示例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");
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}