亚洲免费在线-亚洲免费在线播放-亚洲免费在线观看-亚洲免费在线观看视频-亚洲免费在线看-亚洲免费在线视频

Can a Tomcat docBase span multiple folders?-

系統(tǒng) 2327 0

Question:

I apologize if this is a poor question, but I'm using Windows and looking to see if there's a way to run a webapp via Tomcat where the? docBase ?is multiple folders.

A little more background is that we have our Eclipse project set up in a way that the web content is broken into separate folders. One folder represents what our SDK provides, one is a folder which has SDK patches, and a third is the project-specific components -- either of the last two folders could have subfolders/files that "erase" items from the first two.

I'd like to try and have my context file point back into my dev environment so that I don't need to build/deploy in order to see the changes I'm making. Is this possible?

A couple other notes:

  • We thought about using symlinks via? mklink , but didn't want to create complexity if simplicity was out there.
  • This is just for running locally so simple hacks would be allowed. When we create the WAR which gets deployed to the real environment the ANT script creates a single web root.

?

Answer 1:

I use it this way:

    
          <Context docBase="jquery"                path="/js/jquery" />

    <Context docBase="foobar/www/javascript" path="/js" />

    <Context docBase="foobar/www/css"        path="/css" />

    <Context docBase="foobar"                path="/" />


    
  

Important for the concrete context is the path-attribute. A request is processed from top to bottom.

So a request for? /css/default.css ?is only processed from the 3rd context.

A different order may catches a different context.

This is? wrong :

    
          <Context docBase="foobar"                path="/" />

    <Context docBase="jquery"                path="/js/jquery" />

    <Context docBase="foobar/www/javascript" path="/js" />

    <Context docBase="foobar/www/css"        path="/css" />


    
  

Because? /css/default.css ?will be catched by the first context, not the fourth.

Edit 2013-08-10: ?(Not by the answer-author) It is important to note that while the above technique will work, much of it is actually incorrect. Please see comments for details.

?

Answer 2:

Tomcat can do this for you, you just need a little extra configuration.

You are looking for? VirtualDirContext ?which allows you to specify a list of? extraResourcePaths ?which will be searched (in order) for additional files. You can use that to merge static resources, JSPs, directories of JAR files, etc.

Just remember that each path you add makes every file lookup potentially take longer -- especially if the file can't be found at all.

?

原文:http://stackoverflow.com/questions/17738049/can-a-tomcat-docbase-span-multiple-folders/17861223#17861223

?

Can a Tomcat docBase span multiple folders?--轉(zhuǎn)


更多文章、技術(shù)交流、商務(wù)合作、聯(lián)系博主

微信掃碼或搜索:z360901061

微信掃一掃加我為好友

QQ號(hào)聯(lián)系: 360901061

您的支持是博主寫作最大的動(dòng)力,如果您喜歡我的文章,感覺我的文章對(duì)您有幫助,請(qǐng)用微信掃描下面二維碼支持博主2元、5元、10元、20元等您想捐的金額吧,狠狠點(diǎn)擊下面給點(diǎn)支持吧,站長(zhǎng)非常感激您!手機(jī)微信長(zhǎng)按不能支付解決辦法:請(qǐng)將微信支付二維碼保存到相冊(cè),切換到微信,然后點(diǎn)擊微信右上角掃一掃功能,選擇支付二維碼完成支付。

【本文對(duì)您有幫助就好】

您的支持是博主寫作最大的動(dòng)力,如果您喜歡我的文章,感覺我的文章對(duì)您有幫助,請(qǐng)用微信掃描上面二維碼支持博主2元、5元、10元、自定義金額等您想捐的金額吧,站長(zhǎng)會(huì)非常 感謝您的哦!!!

發(fā)表我的評(píng)論
最新評(píng)論 總共0條評(píng)論
主站蜘蛛池模板: 久久伊人中文字幕有码 | 成人短视频网站 | 影音先锋久草 | 91在线手机精品免费观看 | 久久在线观看免费视频 | 福利视频一区二区 | 欧日韩美香蕉在线观看 | 欧美毛片一级的免费的 | 亚洲三级久久 | 久久久久久夜精品精品免费 | 亚洲第一永久在线观看 | 国产精品九九视频 | 亚洲七七久久精品中文国产 | 26uuu在线视频| 美女bbxx美女bbb | 最新男同志freevideos | 天天骑天天干 | 亚洲成人精品视频 | 波多野野结衣1区二区 | 国产动作大片中文字幕 | 狠狠色丁香婷婷综合最新地址 | 在线国产一区二区 | 综合久久精品 | 国产在视频线精品www666 | 成人a在线观看 | 2018天天操 | 久久噜噜噜久久亚洲va久 | 激情欧美一区二区三区中文字幕 | 4hu最新网址 | 九九热亚洲精品综合视频 | 亚洲精品日韩一区二区 | 高清国产在线 | 哪个网站能看毛片 | 欧美性生活一级 | 男人的天堂222eee | 成人三级毛片 | 午夜久久久精品 | 99九九国产精品免费视频 | 九九久久视频 | 亚洲欧美日韩专区 | 天天爽夜夜爽夜夜爽精品视频 |