Rory's Blog
          Happy study,Happy work,Happy life
          posts - 22,  comments - 46,  trackbacks - 0
          前面一篇文章提到通過webwork的interceptor給webwork的action設(shè)置初始值,

          如何給webwork的action里的Field設(shè)置初始值

          jdev說到"為什么要放在這里,而不是放到系統(tǒng)配置文件中,然后在系統(tǒng)設(shè)置界面中提供設(shè)置",后來我就用spring來注入了。現(xiàn)在就把值放入properties文件中了。

          ????<bean?id="propertyPlaceholderConfigurer"?class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
          ??????
          <property?name="locations">
          ????????
          <list>
          ??????????
          <value>classpath:mail.properties</value>
          ??????????
          <value>classpath:upload.properties</value>
          ????????
          </list>
          ??????
          </property>
          ????
          </bean>
          ????
          <!--?收發(fā)外部郵箱?author:somebody-->
          ????
          <bean?id="outMailManager"?class="cn.com.fivefortunes.mail.manager.impl.OutMailManagerImpl">
          ????????
          <property?name="javaMailSender"><ref?bean="javaMailSender"/></property>
          ????????
          <property?name="attachementDirectory"><value>${mail.attachementDirectory}</value></property>
          ????????
          <property?name="uploadFileDirectory"><value>${upload.directory}</value></property>
          ????????
          <property?name="outMailHibernateManager"><ref?bean="outMailHibernateManager"/></property>
          ????????
          <property?name="outMailAccountManager"><ref?bean="outMailAccountManager"/></property>
          ????
          </bean>
          這樣把uploadFileDirectory放入mananger中去了。在properties里面配置一下就ok了。

          upload.directory
          =D:\\tomcat5\\webapps\\files
          mail.attachementDirectory
          =D:\\tomcat5\\webapps\\files
          上次還有網(wǎng)友這樣說到"return ServletActionContext.getServletContext().getRealPath("/");

          你這樣換了部署環(huán)境每次都要改
          而且也該是
          D://tomcat5//webapps//files"
          也許很多人都以為這是最好的方式,可是實際情況不是這樣,我們的uploadfile目錄已經(jīng)有3G的文件,而基本上每天我們都要發(fā)布新的webapp,如果把uploadfile目錄放到webapp的一個子目錄,每次部署的時候都要先把uploadfile copy出來然后再部署。所以我們這么做就是把upload目錄放到其他目錄不影響uploadfile目錄里面的文件。關(guān)于我們項目的部署見我的下一篇文章。謝謝大家。如果您有什么更好的方法請您指教。
          posted on 2006-04-22 11:21 莫多 閱讀(1194) 評論(0)  編輯  收藏 所屬分類: WebworkSpring

          <2006年4月>
          2627282930311
          2345678
          9101112131415
          16171819202122
          23242526272829
          30123456

          常用鏈接

          留言簿(1)

          隨筆分類(27)

          隨筆檔案(22)

          Friends

          搜索

          •  

          積分與排名

          • 積分 - 62467
          • 排名 - 845

          最新評論

          閱讀排行榜

          評論排行榜

          主站蜘蛛池模板: 宁德市| 蓬安县| 大城县| 额尔古纳市| 延庆县| 红河县| 台东县| 波密县| 闽侯县| 福鼎市| 铜川市| 民丰县| 明光市| 黄浦区| 水城县| 东源县| 凭祥市| 微山县| 朔州市| 浮山县| 姚安县| 郓城县| 呼伦贝尔市| 潜江市| 靖宇县| 延寿县| 张掖市| 濉溪县| 乾安县| 綦江县| 集贤县| 隆德县| 大理市| 西丰县| 内黄县| 清镇市| 靖边县| 沧源| 东台市| 彭泽县| 卢氏县|