Rory's Blog
          Happy study,Happy work,Happy life
          posts - 22,  comments - 46,  trackbacks - 0
          項目中多個項目需要同時引用一個靜態(tài)資源,所以就想到配置不同的虛擬目錄指到同一個目錄。于是有下面的配置:
          ????<!--?configures?the?default?host,?matching?any?host?name?-->
          ????
          <host?id=""?root-directory=".">
          ??????
          <!--
          ?????????-?configures?an?explicit?root?web-app?matching?the
          ?????????-?webapp's?ROOT
          ????????
          -->
          ??????
          <web-app?id="/"?document-directory="webapps/ROOT"/>
          ??????
          <web-app?id="/community/jsvm2"?document-directory="D:\\projects\\FelooComponents\\jsvm2"/>
          ??????
          <web-app?id="/passport/jsvm2"?document-directory="D:\\projects\\FelooComponents\\jsvm2"/>
          ????
          </host>

          ?????? 但是發(fā)現(xiàn)這樣只有后面一個管用(http://localhost:8080/passport/jsvm2)這個是可以,可是(http://localhost:8080/community/jsvm2)就不行,很是郁悶。只要后面的document-directory不是同一個目錄就成。
          ?????? 后來在resin的doc里面看到path的配置

          path-mapping

          child of: web-app-default, web-app

          Maps url patterns to real paths. If using a server like IIS, you may need to match the server's path aliases.

          AttributeMeaningdefault
          url-patternA pattern matching the url: /foo/*, /foo, or *.foo
          url-regexpA regular expression matching the url
          real-pathThe prefix of the real path. When used with url-regexp, allows substitution variables like $1.

          <web-app id='/'>
                      <path-mapping url-pattern='/resin/*'
                      real-path='e:\resin'/>
                      <path-mapping url-regexp='/~([^/]*)'
                      real-path='e:\home$1'/>
                      </web-app>
                      

          改正這樣的配置就ok了。

          ????????<web-app?id="/community"?document-directory="D:\\projects\\FelooCommunityWeb">
          ??????????
          <path-mapping?url-pattern='jsvm2/*'
          ??????????????
          real-path='D:\\projects\\FelooComponents\\jsvm2'/>
          ??????
          </web-app>
          ??????
          ????????????
          <web-app?id="/passport"?document-directory="D:\\projects\\FelooPassportWeb">
          ??????????
          <path-mapping?url-pattern='jsvm2/*'
          ??????????????
          real-path='D:\\projects\\FelooComponents\\jsvm2'/>
          ??????
          </web-app>
          創(chuàng)造共用協(xié)議:署名,非商業(yè),保持一致?? 除經(jīng)特別注明外,本文章版權(quán)歸莫多泡泡所有.
          署名,非商業(yè)用途,保持一致.???somebody(莫多)
          posted on 2006-07-18 19:41 莫多 閱讀(2905) 評論(0)  編輯  收藏 所屬分類: Other

          <2006年7月>
          2526272829301
          2345678
          9101112131415
          16171819202122
          23242526272829
          303112345

          常用鏈接

          留言簿(1)

          隨筆分類(27)

          隨筆檔案(22)

          Friends

          搜索

          •  

          積分與排名

          • 積分 - 62375
          • 排名 - 845

          最新評論

          閱讀排行榜

          評論排行榜

          主站蜘蛛池模板: 贵定县| 平顶山市| 龙泉市| 大邑县| 五河县| 敖汉旗| 望城县| 富平县| 扶绥县| 龙胜| 泰州市| 德兴市| 成武县| 洪江市| 合阳县| 张家界市| 静安区| 建湖县| 新巴尔虎右旗| 墨竹工卡县| 清徐县| 大埔区| 汝城县| 九台市| 松江区| 怀集县| 昔阳县| 大方县| 建昌县| 贵州省| 兴隆县| 开封县| 华坪县| 三原县| 泰兴市| 长宁区| 平度市| 云霄县| 确山县| 嘉鱼县| 清新县|