请教j2ee高手,帮我分析下,重谢

313559947 发布于 2010/04/14 20:32
阅读 308
收藏 1

import cn.ccb.foundation.web.AbstractApplicationBean;

public class ApplicationBean extends AbstractApplicationBean {

 public ApplicationBean() {
 }

 public void init() {
  super.init();
 }

 public void destroy() {
 }

 public String getLocaleCharacterEncoding() {
  return super.getLocaleCharacterEncoding();
 }
}

<faces-config>
  <application>
    <view-handler>org.apache.myfaces.application.jsp.JspTilesViewHandlerImpl</view-handler>
    <variable-resolver>org.springframework.web.jsf.DelegatingVariableResolver</variable-resolver>
    <locale-config />
  </application>
  <lifecycle>
    <phase-listener>cn.ccb.foundation.web.PhaseTracker</phase-listener>
  </lifecycle>
  <managed-bean>
    <managed-bean-name>ApplicationBean</managed-bean-name>
    <managed-bean-class>cn.ccb.ceshi1.common.web.ApplicationBean</managed-bean-class>
    <managed-bean-scope>application</managed-bean-scope>
  </managed-bean>
  <managed-bean>
    <managed-bean-name>SessionBean</managed-bean-name>
    <managed-bean-class>cn.ccb.ceshi1.common.web.SessionBean</managed-bean-class>
    <managed-bean-scope>session</managed-bean-scope>
  </managed-bean>
  <managed-bean>
    <managed-bean-name>RequestBean</managed-bean-name>
    <managed-bean-class>cn.ccb.ceshi1.common.web.RequestBean</managed-bean-class>
    <managed-bean-scope>request</managed-bean-scope>
  </managed-bean>
</faces-config>

public class Chulaiba extends AbstractPageBean {

 protected ApplicationBean getApplicationBean() {
  return (ApplicationBean)getBean("ApplicationBean");
 }

 protected SessionBean getSessionBean() {
  return (SessionBean)getBean("SessionBean");
 }

  protected RequestBean getRequestBean() {
  return (RequestBean)getBean("RequestBean");
 }

 public String kpiDeptOneMtdAdd(){
  //TODO:please implements this method
  this.getRequestBean().saveValue("deptId", deptId);
  return "kpiDeptOneMtdAdd";
 }
  }

上面3个类具体讲的都是什么意思,看不懂?谁好心给我分析下,谢谢了

 

而且我发现我项目里确实没这个包import cn.ccb.foundation.web.AbstractPageBean;

KpiDeptOneMtdManage 是托管bean继承AbstractPageBean 类,继承这个类有什么好处?

 

ApplicationBean extends AbstractApplicationBean  继承这个类有什么好处?而且有init() destroy(),这2个方法有什么用

 

this.getRequestBean().saveValue("deptId", deptId); 这句话代表什么意思,找了没找到有savaValue这个方法

 

加载中
0
火红莲
火红莲

1\cn.ccb.foundation.web.AbstractPageBea 这个包不可能没有,否则就运行出错..

2\ApplicationBean extends AbstractApplicationBean  java的三要素.init() destroy() 是AbstractApplicationBean  虚方法或扩展实现吧.

3\this.getRequestBean().saveValue("deptId", deptId); 往request的塞入一个属性...估计是页面需要为deptId赋值吧

返回顶部
顶部