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

📄 hibernateplugin.java

📁 Java开发的权限管理的例子
💻 JAVA
字号:
package org.artemis.manager.common;

import javax.servlet.ServletException;

import org.apache.struts.action.ActionServlet;
import org.apache.struts.action.PlugIn;
import org.apache.struts.config.ModuleConfig;

/*web-config.xml 配置
 * <plug-in className="com.hw.framework.struts.strutsHibernatePlugIn">
    <set-property property="configFile" value="/hibernate.cfg.xml"/>
 </plug-in>
 */
public class HibernatePlugIn  implements PlugIn{
	 private String configFile;
	 // This method will be called at application shutdown time
	 public void destroy() {
	  System.out.println("Entering HibernatePlugIn.destroy()");

	  System.out.println("Exiting HibernatePlugIn.destroy()");
	 }
	 //This method will be called at application startup time
	 public void init(ActionServlet actionServlet, ModuleConfig config)
	  throws ServletException {

	  System.out.println("开始读hibernate配置文件 " +
	                      getConfigFile());
	 // HibernateSessionFactory.currentSession();
	  System.out.println("hibernate文件配置完毕");
	 }
	 public String getConfigFile() {
	  return configFile;
	 }
	 public void setConfigFile(String string) {
	  configFile = string;
	 }

}

⌨️ 快捷键说明

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