⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 baseaction.java

📁 jaguey,网上的一个朋友给我的
💻 JAVA
字号:
package net.javapassion.jaguey.web.action;

import javax.servlet.ServletContext;
import org.apache.struts.action.Action;
import org.apache.struts.action.ActionServlet;
import org.springframework.web.context.WebApplicationContext;
import org.springframework.web.context.support.WebApplicationContextUtils;
import net.javapassion.jaguey.service.*;

//版本: JagueyBBS 1.1
//功能: 注射业务逻辑实例
//作者: 赵程佳
//时间: 2006-02-13 19:10:01

public class BaseAction extends Action {
	private WebApplicationContext webApplicationContext;
	
	public void setServlet(ActionServlet actionServlet) {
		super.setServlet(actionServlet);
        ServletContext servletContext = actionServlet.getServletContext();
        webApplicationContext = WebApplicationContextUtils.getRequiredWebApplicationContext(servletContext);
	}
	
	protected AssortOper getAssortOper() {
	    return (AssortOper) webApplicationContext.getBean("assortOper");
	}
	
	protected BoardOper getBoardOper() {
		return (BoardOper) webApplicationContext.getBean("boardOper");
	}
	
	protected CollTopicOper getCollTopicOper() {
		return (CollTopicOper) webApplicationContext.getBean("collTopicOper");
	}
	
	protected FriendUserOper getFriendUserOper() {
		return (FriendUserOper) webApplicationContext.getBean("friendUserOper");
	}
	
	protected InfoBoxOper getInfoBoxOper() {
		return (InfoBoxOper) webApplicationContext.getBean("infoBoxOper");
	}
	
	protected LinkOper getLinkOper() {
		return (LinkOper) webApplicationContext.getBean("linkOper");
	}
	
	protected NoteMessOper getNoteMessOper() {
		return (NoteMessOper) webApplicationContext.getBean("noteMessOper");
	}
	
	protected OnlineOper getOnlineOper() {
		return (OnlineOper) webApplicationContext.getBean("onlineOper");
	}
	
	protected RevertOper getRevertOper() {
		return (RevertOper) webApplicationContext.getBean("revertOper");
	}
	
	protected TopicOper getTopicOper() {
		return (TopicOper) webApplicationContext.getBean("topicOper");
	}
	
	protected TopicTypeOper getTopicTypeOper() {
		return (TopicTypeOper) webApplicationContext.getBean("topicTypeOper");
	}
	
	protected UserInfoOper getUserInfoOper() {
		return (UserInfoOper) webApplicationContext.getBean("userInfoOper");
	}
	
	protected UserRoleOper getUserRoleOper() {
		return (UserRoleOper) webApplicationContext.getBean("userRoleOper");
	}
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -