BaseAction.java 文件源码

java
阅读 42 收藏 0 点赞 0 评论 0

项目:atmars 作者:
protected void InitAction() {
    webRootPath = ServletActionContext.getServletContext().getRealPath("/");
    String xmlPath=webRootPath
            + "WEB-INF\\applicationContext.xml";

    ApplicationContext appContext = new FileSystemXmlApplicationContext(xmlPath);
    //Resource res = new FileSystemResource(webRootPath
    //      + "WEB-INF\\applicationContext.xml");
    //XmlBeanFactory factory = new XmlBeanFactory(res);
    BeanFactory factory = appContext;
    mService = (MessageService) factory.getBean("messageService");
    uService = (UserService) factory.getBean("userService");
    jMail = (Jmail) factory.getBean("jmail");
    mailServiceMdp = (MailServiceMdp) factory.getBean("mailServiceMdp");
    factory.getBean("listnerContainer");
    ActionContext ctx = ActionContext.getContext();
    Map<String, Object> session = ctx.getSession();
    currentUserFromSession = (User) session.get("user");
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号