<rt id="bn8ez"></rt>
<label id="bn8ez"></label>

  • <span id="bn8ez"></span>

    <label id="bn8ez"><meter id="bn8ez"></meter></label>

    posts - 325,  comments - 25,  trackbacks - 0
    1.注意在加載完hiberna包之后,放入以下三個jar包:spring.jar commons-collection-3.2.jar,commons-pool-1.3.jar,刪除兩個包由于cglib-2.1.3,(cglib-2.1.3 依賴的asm 跟在外邊的asm版本不一致導致, 把cglib換成 cglib-nodep版本的就可以了),asm-2.2.3.jar
    2.從數據庫映射完vo之后,注意一對多,多對多等的配置
           一對多: 如:“一”這方ExamType.hbm.xml 添加
            <set name="questions" inverse="true"> //“一”這方沒有控制權
                 <key column="typeid"></key>
                 <one-to-many class="com.lhb.onlineexam.vo.Question"/>
              </set>
                    
                “多”這方Question.hbm.xml 添加
                    <many-to-one name="examtype" column="typeid" not-null="true" lazy="false" insert="false"></many-to-one>
                “多”這方有控制權

         多對多:
            如course.hbm.xml 
            <set name="student" table="student_course" cascade="save-update"
             inverse="true">
                 <key column="cou_id"></key>
                 <many-to-many column="stu_id"
                  class="com.lhb.first.vo.Student">
                 </many-to-many>
            </set>

            student.hbm.xml
            
                <set name="course" cascade="save-update" inverse="false"  //因為是學生選課,不是課先學生,所以有控制權
                   table="student-course">
                       <key column="stu_id"></key>
                       <many-to-many column="cou_id"
                        class="com.lhb.first.vo.Course">
                       </many-to-many>
                  </set>

        3.   web.xml中的配置
        加入:
     <context-param>
      <param-name>contextConfigLocation</param-name>
      <param-value>/WEB-INF/applicationContext.xml</param-value>
     </context-param>
     <servlet>
      <servlet-name>SpringContextServlet</servlet-name>
      <servlet-class>
       org.springframework.web.context.ContextLoaderServlet
      </servlet-class>
      <load-on-startup>1</load-on-startup>
     </servlet>
     <filter>
      <filter-name>requestContextFilter</filter-name>
      <filter-class>org.springframework.web.filter.RequestContextFilter</filter-class>
     </filter>
     <filter-mapping>
      <filter-name>requestContextFilter</filter-name>
      <url-pattern>/*</url-pattern>
     </filter-mapping>
     <filter>
      <filter-name>encodingFilter</filter-name>
      <filter-class>
       org.springframework.web.filter.CharacterEncodingFilter
      </filter-class>
      <init-param>
       <param-name>encoding</param-name>
       <param-value>UTF-8</param-value>
      </init-param>
     </filter>
     <filter-mapping>
      <filter-name>encodingFilter</filter-name>
      <url-pattern>/*</url-pattern>
     </filter-mapping>   

    4.在完成模型組件和業務邏輯組件之后,配置applicationContext.xml(注入bean)
    5.加入struts支持,配置struts-config.xml
        <plug-in className="org.springframework.web.struts.ContextLoaderPlugIn">
        <set-property property="contextConfigLocation" value="/WEB-INF/applicationContext.xml" />
      </plug-in> 
        如果使用spring的DelegatingRequestProcessor(此時可以沒有type屬性),則在struts-config.xml中加入
        <controller processorClass="org.springframework.web.struts.DelegatingRequestProcessor"></controller>
        如果使用spring的DelegatingActionProxy(此時type都是type="org.springframework.web.struts.DelegatingActionProxy")
        struts-config.xml中什么也不加
            
    posted on 2008-05-15 15:56 長春語林科技 閱讀(163) 評論(0)  編輯  收藏 所屬分類: util
    <2008年5月>
    27282930123
    45678910
    11121314151617
    18192021222324
    25262728293031
    1234567

     

    長春語林科技歡迎您!

    常用鏈接

    留言簿(6)

    隨筆分類

    隨筆檔案

    文章分類

    文章檔案

    相冊

    收藏夾

    搜索

    •  

    最新評論

    閱讀排行榜

    評論排行榜

    主站蜘蛛池模板: 亚洲最新黄色网址| 亚洲一区二区三区久久| 国产产在线精品亚洲AAVV| 97视频热人人精品免费| 国产成人精品日本亚洲直接| 久草视频免费在线| 亚洲综合偷自成人网第页色 | 永久免费无码日韩视频| 国产一级淫片a免费播放口之| 亚洲AV无码成人精品区日韩| 国产精品无码一区二区三区免费| 亚洲成a人无码亚洲成www牛牛| 最新69国产成人精品免费视频动漫 | 国产成+人+综合+亚洲专| 99久久这里只精品国产免费| 中文字幕亚洲男人的天堂网络| 最近中文字幕mv手机免费高清| 亚洲av成本人无码网站| 免费成人av电影| 特级做A爰片毛片免费看无码| 夭天干天天做天天免费看| 亚洲av无码片vr一区二区三区| 又粗又黄又猛又爽大片免费 | 在线视频亚洲一区| 亚洲七七久久精品中文国产| 成人性做爰aaa片免费看| 亚洲视频中文字幕在线| 好吊妞788免费视频播放| 一级毛片正片免费视频手机看| 亚洲午夜福利AV一区二区无码| 99久久综合精品免费| 亚洲中文无码mv| 日本成年免费网站| 自拍偷自拍亚洲精品播放| 亚洲日本乱码在线观看| 国产精品成人观看视频免费| 边摸边脱吃奶边高潮视频免费 | 亚洲午夜无码AV毛片久久| 女人隐私秘视频黄www免费| 日本免费无遮挡吸乳视频电影| 色欲aⅴ亚洲情无码AV|