日期:2014-05-16 浏览次数:20477 次
public class PRequestHisIpBean{ // 引用另外的管理Bean private NetManageBean netmanage ; public PRequestHisIpBean(){ // 执行引用Bean的方法 if(netmanage!=null)netmanage.manageNet(); } public NetManageBean getNetmanage() { if(netmanage==null)netmanage=new NetManageBean(); return netmanage; } public void setNetmanage(NetManageBean netmanage) { this.netmanage = netmanage; } }
<managed-bean> <managed-bean-name>netmanage</managed-bean-name> <managed-bean-class> com.system.NetManageBean </managed-bean-class> <managed-bean-scope>session</managed-bean-scope> </managed-bean> <managed-bean> <managed-bean-name>RequestIp</managed-bean-name> <managed-bean-class> com.report.PRequestHisIpBean </managed-bean-class> <managed-bean-scope>session</managed-bean-scope> <managed-property> <property-name>netmanage</property-name> <value>#{netmanage}</value> </managed-property> </managed-bean>
public class PRequestHisIpBean{ // 引用另外的管理Bean private NetManageBean netmanage ; public PRequestHisIpBean(){ } public NetManageBean getNetmanage() { if(netmanage==null)netmanage=new NetManageBean(); return netmanage; } public void setNetmanage(NetManageBean netmanage) { this.netmanage = netmanage; // 执行引用Bean的方法 if(netmanage!=null)netmanage.manageNet(); } }