Author: slaurent
Date: Sat Dec  3 21:37:49 2011
New Revision: 1210012

URL: http://svn.apache.org/viewvc?rev=1210012&view=rev
Log:
Fix https://issues.apache.org/bugzilla/show_bug.cgi?id=51741
bug 51741: Eclipse WTP "Serve modules without publishing" broken with tc7, 
needs patch in tomcat 
https://issues.apache.org/bugzilla/show_bug.cgi?id=51741
merged revisions 1209685:1209731 from trunk to tc7

Added:
    tomcat/tc7.0.x/trunk/test/org/apache/catalina/loader/EchoTag.java
      - copied unchanged from r1209731, 
tomcat/trunk/test/org/apache/catalina/loader/EchoTag.java
    tomcat/tc7.0.x/trunk/test/org/apache/catalina/loader/MyAnnotatedServlet.java
      - copied unchanged from r1209731, 
tomcat/trunk/test/org/apache/catalina/loader/MyAnnotatedServlet.java
    tomcat/tc7.0.x/trunk/test/org/apache/catalina/loader/TestVirtualContext.java
      - copied unchanged from r1209731, 
tomcat/trunk/test/org/apache/catalina/loader/TestVirtualContext.java
    tomcat/tc7.0.x/trunk/test/webapp-3.0-virtual-library/
      - copied from r1209731, tomcat/trunk/test/webapp-3.0-virtual-library/
    tomcat/tc7.0.x/trunk/test/webapp-3.0-virtual-library/target/
      - copied from r1209731, 
tomcat/trunk/test/webapp-3.0-virtual-library/target/
    tomcat/tc7.0.x/trunk/test/webapp-3.0-virtual-library/target/classes/
      - copied from r1209731, 
tomcat/trunk/test/webapp-3.0-virtual-library/target/classes/
    
tomcat/tc7.0.x/trunk/test/webapp-3.0-virtual-library/target/classes/META-INF/
      - copied from r1209731, 
tomcat/trunk/test/webapp-3.0-virtual-library/target/classes/META-INF/
    
tomcat/tc7.0.x/trunk/test/webapp-3.0-virtual-library/target/classes/META-INF/C.tld
      - copied unchanged from r1209731, 
tomcat/trunk/test/webapp-3.0-virtual-library/target/classes/META-INF/C.tld
    
tomcat/tc7.0.x/trunk/test/webapp-3.0-virtual-library/target/classes/META-INF/resources/
      - copied from r1209731, 
tomcat/trunk/test/webapp-3.0-virtual-library/target/classes/META-INF/resources/
    
tomcat/tc7.0.x/trunk/test/webapp-3.0-virtual-library/target/classes/META-INF/resources/rsrc/
      - copied from r1209731, 
tomcat/trunk/test/webapp-3.0-virtual-library/target/classes/META-INF/resources/rsrc/
    
tomcat/tc7.0.x/trunk/test/webapp-3.0-virtual-library/target/classes/META-INF/resources/rsrc/resourceE.properties
      - copied unchanged from r1209731, 
tomcat/trunk/test/webapp-3.0-virtual-library/target/classes/META-INF/resources/rsrc/resourceE.properties
    tomcat/tc7.0.x/trunk/test/webapp-3.0-virtual-library/target/classes/rsrc/
      - copied from r1209731, 
tomcat/trunk/test/webapp-3.0-virtual-library/target/classes/rsrc/
    
tomcat/tc7.0.x/trunk/test/webapp-3.0-virtual-library/target/classes/rsrc/resourceC.properties
      - copied unchanged from r1209731, 
tomcat/trunk/test/webapp-3.0-virtual-library/target/classes/rsrc/resourceC.properties
    tomcat/tc7.0.x/trunk/test/webapp-3.0-virtual-webapp/
      - copied from r1209731, tomcat/trunk/test/webapp-3.0-virtual-webapp/
    tomcat/tc7.0.x/trunk/test/webapp-3.0-virtual-webapp/src/
      - copied from r1209731, tomcat/trunk/test/webapp-3.0-virtual-webapp/src/
    tomcat/tc7.0.x/trunk/test/webapp-3.0-virtual-webapp/src/main/
      - copied from r1209731, 
tomcat/trunk/test/webapp-3.0-virtual-webapp/src/main/
    tomcat/tc7.0.x/trunk/test/webapp-3.0-virtual-webapp/src/main/lib/
      - copied from r1209731, 
tomcat/trunk/test/webapp-3.0-virtual-webapp/src/main/lib/
    tomcat/tc7.0.x/trunk/test/webapp-3.0-virtual-webapp/src/main/lib/META-INF/
      - copied from r1209731, 
tomcat/trunk/test/webapp-3.0-virtual-webapp/src/main/lib/META-INF/
    
tomcat/tc7.0.x/trunk/test/webapp-3.0-virtual-webapp/src/main/lib/META-INF/B.tld
      - copied unchanged from r1209731, 
tomcat/trunk/test/webapp-3.0-virtual-webapp/src/main/lib/META-INF/B.tld
    tomcat/tc7.0.x/trunk/test/webapp-3.0-virtual-webapp/src/main/lib/rsrc/
      - copied from r1209731, 
tomcat/trunk/test/webapp-3.0-virtual-webapp/src/main/lib/rsrc/
    
tomcat/tc7.0.x/trunk/test/webapp-3.0-virtual-webapp/src/main/lib/rsrc/resourceD.properties
      - copied unchanged from r1209731, 
tomcat/trunk/test/webapp-3.0-virtual-webapp/src/main/lib/rsrc/resourceD.properties
    tomcat/tc7.0.x/trunk/test/webapp-3.0-virtual-webapp/src/main/misc/
      - copied from r1209731, 
tomcat/trunk/test/webapp-3.0-virtual-webapp/src/main/misc/
    
tomcat/tc7.0.x/trunk/test/webapp-3.0-virtual-webapp/src/main/misc/resourceI.properties
      - copied unchanged from r1209731, 
tomcat/trunk/test/webapp-3.0-virtual-webapp/src/main/misc/resourceI.properties
    tomcat/tc7.0.x/trunk/test/webapp-3.0-virtual-webapp/src/main/webapp/
      - copied from r1209731, 
tomcat/trunk/test/webapp-3.0-virtual-webapp/src/main/webapp/
    
tomcat/tc7.0.x/trunk/test/webapp-3.0-virtual-webapp/src/main/webapp/META-INF/
      - copied from r1209731, 
tomcat/trunk/test/webapp-3.0-virtual-webapp/src/main/webapp/META-INF/
    tomcat/tc7.0.x/trunk/test/webapp-3.0-virtual-webapp/src/main/webapp/WEB-INF/
      - copied from r1209731, 
tomcat/trunk/test/webapp-3.0-virtual-webapp/src/main/webapp/WEB-INF/
    
tomcat/tc7.0.x/trunk/test/webapp-3.0-virtual-webapp/src/main/webapp/WEB-INF/A.tld
      - copied unchanged from r1209731, 
tomcat/trunk/test/webapp-3.0-virtual-webapp/src/main/webapp/WEB-INF/A.tld
    
tomcat/tc7.0.x/trunk/test/webapp-3.0-virtual-webapp/src/main/webapp/WEB-INF/classes/
      - copied from r1209731, 
tomcat/trunk/test/webapp-3.0-virtual-webapp/src/main/webapp/WEB-INF/classes/
    
tomcat/tc7.0.x/trunk/test/webapp-3.0-virtual-webapp/src/main/webapp/WEB-INF/classes/rsrc/
      - copied from r1209731, 
tomcat/trunk/test/webapp-3.0-virtual-webapp/src/main/webapp/WEB-INF/classes/rsrc/
    
tomcat/tc7.0.x/trunk/test/webapp-3.0-virtual-webapp/src/main/webapp/WEB-INF/classes/rsrc/resourceA.properties
      - copied unchanged from r1209731, 
tomcat/trunk/test/webapp-3.0-virtual-webapp/src/main/webapp/WEB-INF/classes/rsrc/resourceA.properties
    
tomcat/tc7.0.x/trunk/test/webapp-3.0-virtual-webapp/src/main/webapp/WEB-INF/lib/
      - copied from r1209731, 
tomcat/trunk/test/webapp-3.0-virtual-webapp/src/main/webapp/WEB-INF/lib/
    
tomcat/tc7.0.x/trunk/test/webapp-3.0-virtual-webapp/src/main/webapp/WEB-INF/lib/rsrc.jar
      - copied unchanged from r1209731, 
tomcat/trunk/test/webapp-3.0-virtual-webapp/src/main/webapp/WEB-INF/lib/rsrc.jar
    
tomcat/tc7.0.x/trunk/test/webapp-3.0-virtual-webapp/src/main/webapp/WEB-INF/web.xml
      - copied unchanged from r1209731, 
tomcat/trunk/test/webapp-3.0-virtual-webapp/src/main/webapp/WEB-INF/web.xml
    
tomcat/tc7.0.x/trunk/test/webapp-3.0-virtual-webapp/src/main/webapp/classpathGetResourceAsStream.jsp
      - copied unchanged from r1209731, 
tomcat/trunk/test/webapp-3.0-virtual-webapp/src/main/webapp/classpathGetResourceAsStream.jsp
    
tomcat/tc7.0.x/trunk/test/webapp-3.0-virtual-webapp/src/main/webapp/classpathGetResourceUrlThenGetStream.jsp
      - copied unchanged from r1209731, 
tomcat/trunk/test/webapp-3.0-virtual-webapp/src/main/webapp/classpathGetResourceUrlThenGetStream.jsp
    
tomcat/tc7.0.x/trunk/test/webapp-3.0-virtual-webapp/src/main/webapp/classpathGetResources.jsp
      - copied unchanged from r1209731, 
tomcat/trunk/test/webapp-3.0-virtual-webapp/src/main/webapp/classpathGetResources.jsp
    
tomcat/tc7.0.x/trunk/test/webapp-3.0-virtual-webapp/src/main/webapp/contextGetRealPath.jsp
      - copied unchanged from r1209731, 
tomcat/trunk/test/webapp-3.0-virtual-webapp/src/main/webapp/contextGetRealPath.jsp
    
tomcat/tc7.0.x/trunk/test/webapp-3.0-virtual-webapp/src/main/webapp/contextGetResource.jsp
      - copied unchanged from r1209731, 
tomcat/trunk/test/webapp-3.0-virtual-webapp/src/main/webapp/contextGetResource.jsp
    
tomcat/tc7.0.x/trunk/test/webapp-3.0-virtual-webapp/src/main/webapp/contextGetResourcePaths.jsp
      - copied unchanged from r1209731, 
tomcat/trunk/test/webapp-3.0-virtual-webapp/src/main/webapp/contextGetResourcePaths.jsp
    tomcat/tc7.0.x/trunk/test/webapp-3.0-virtual-webapp/src/main/webapp/rsrc/
      - copied from r1209731, 
tomcat/trunk/test/webapp-3.0-virtual-webapp/src/main/webapp/rsrc/
    
tomcat/tc7.0.x/trunk/test/webapp-3.0-virtual-webapp/src/main/webapp/rsrc/resourceF.properties
      - copied unchanged from r1209731, 
tomcat/trunk/test/webapp-3.0-virtual-webapp/src/main/webapp/rsrc/resourceF.properties
    
tomcat/tc7.0.x/trunk/test/webapp-3.0-virtual-webapp/src/main/webapp/testTlds.jsp
      - copied unchanged from r1209731, 
tomcat/trunk/test/webapp-3.0-virtual-webapp/src/main/webapp/testTlds.jsp
    tomcat/tc7.0.x/trunk/test/webapp-3.0-virtual-webapp/src/main/webapp2/
      - copied from r1209731, 
tomcat/trunk/test/webapp-3.0-virtual-webapp/src/main/webapp2/
    
tomcat/tc7.0.x/trunk/test/webapp-3.0-virtual-webapp/src/main/webapp2/WEB-INF/
      - copied from r1209731, 
tomcat/trunk/test/webapp-3.0-virtual-webapp/src/main/webapp2/WEB-INF/
    
tomcat/tc7.0.x/trunk/test/webapp-3.0-virtual-webapp/src/main/webapp2/WEB-INF/D.tld
      - copied unchanged from r1209731, 
tomcat/trunk/test/webapp-3.0-virtual-webapp/src/main/webapp2/WEB-INF/D.tld
    
tomcat/tc7.0.x/trunk/test/webapp-3.0-virtual-webapp/src/main/webapp2/WEB-INF/classes/
      - copied from r1209731, 
tomcat/trunk/test/webapp-3.0-virtual-webapp/src/main/webapp2/WEB-INF/classes/
    
tomcat/tc7.0.x/trunk/test/webapp-3.0-virtual-webapp/src/main/webapp2/WEB-INF/classes/rsrc/
      - copied from r1209731, 
tomcat/trunk/test/webapp-3.0-virtual-webapp/src/main/webapp2/WEB-INF/classes/rsrc/
    
tomcat/tc7.0.x/trunk/test/webapp-3.0-virtual-webapp/src/main/webapp2/WEB-INF/classes/rsrc/resourceG.properties
      - copied unchanged from r1209731, 
tomcat/trunk/test/webapp-3.0-virtual-webapp/src/main/webapp2/WEB-INF/classes/rsrc/resourceG.properties
    
tomcat/tc7.0.x/trunk/test/webapp-3.0-virtual-webapp/src/main/webapp2/WEB-INF/classes/rsrc2/
      - copied from r1209731, 
tomcat/trunk/test/webapp-3.0-virtual-webapp/src/main/webapp2/WEB-INF/classes/rsrc2/
    
tomcat/tc7.0.x/trunk/test/webapp-3.0-virtual-webapp/src/main/webapp2/WEB-INF/classes/rsrc2/resourceK.properties
      - copied unchanged from r1209731, 
tomcat/trunk/test/webapp-3.0-virtual-webapp/src/main/webapp2/WEB-INF/classes/rsrc2/resourceK.properties
    tomcat/tc7.0.x/trunk/test/webapp-3.0-virtual-webapp/src/main/webapp2/rsrc/
      - copied from r1209731, 
tomcat/trunk/test/webapp-3.0-virtual-webapp/src/main/webapp2/rsrc/
    
tomcat/tc7.0.x/trunk/test/webapp-3.0-virtual-webapp/src/main/webapp2/rsrc/resourceF.properties
      - copied unchanged from r1209731, 
tomcat/trunk/test/webapp-3.0-virtual-webapp/src/main/webapp2/rsrc/resourceF.properties
    
tomcat/tc7.0.x/trunk/test/webapp-3.0-virtual-webapp/src/main/webapp2/rsrc/resourceH.properties
      - copied unchanged from r1209731, 
tomcat/trunk/test/webapp-3.0-virtual-webapp/src/main/webapp2/rsrc/resourceH.properties
    tomcat/tc7.0.x/trunk/test/webapp-3.0-virtual-webapp/src/main/webapp2/rsrc2/
      - copied from r1209731, 
tomcat/trunk/test/webapp-3.0-virtual-webapp/src/main/webapp2/rsrc2/
    
tomcat/tc7.0.x/trunk/test/webapp-3.0-virtual-webapp/src/main/webapp2/rsrc2/resourceJ.properties
      - copied unchanged from r1209731, 
tomcat/trunk/test/webapp-3.0-virtual-webapp/src/main/webapp2/rsrc2/resourceJ.properties
    tomcat/tc7.0.x/trunk/test/webapp-3.0-virtual-webapp/target/
      - copied from r1209731, 
tomcat/trunk/test/webapp-3.0-virtual-webapp/target/
    tomcat/tc7.0.x/trunk/test/webapp-3.0-virtual-webapp/target/classes/
      - copied from r1209731, 
tomcat/trunk/test/webapp-3.0-virtual-webapp/target/classes/
    tomcat/tc7.0.x/trunk/test/webapp-3.0-virtual-webapp/target/classes/rsrc/
      - copied from r1209731, 
tomcat/trunk/test/webapp-3.0-virtual-webapp/target/classes/rsrc/
    
tomcat/tc7.0.x/trunk/test/webapp-3.0-virtual-webapp/target/classes/rsrc/resourceB.properties
      - copied unchanged from r1209731, 
tomcat/trunk/test/webapp-3.0-virtual-webapp/target/classes/rsrc/resourceB.properties
Modified:
    tomcat/tc7.0.x/trunk/   (props changed)
    tomcat/tc7.0.x/trunk/.gitignore
    tomcat/tc7.0.x/trunk/java/org/apache/catalina/core/StandardContext.java
    tomcat/tc7.0.x/trunk/java/org/apache/catalina/loader/WebappClassLoader.java
    tomcat/tc7.0.x/trunk/java/org/apache/catalina/startup/ContextConfig.java
    tomcat/tc7.0.x/trunk/java/org/apache/naming/resources/VirtualDirContext.java
    tomcat/tc7.0.x/trunk/webapps/docs/config/context.xml
    tomcat/tc7.0.x/trunk/webapps/docs/config/resources.xml

Propchange: tomcat/tc7.0.x/trunk/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Sat Dec  3 21:37:49 2011
@@ -1 +1 @@
-/tomcat/trunk:1156115,1156171,1156276,1156304,1156519,1156530,1156602,1157015,1157018,1157151,1157198,1157204,1157810,1157832,1157834,1157847,1157908,1157939,1158155,1158160,1158176,1158195,1158198-1158199,1158227,1158331,1158334-1158335,1158426,1160347,1160592,1160611,1160619,1160626,1160639,1160652,1160720-1160721,1160772,1160774,1160776,1161303,1161310,1161322,1161339,1161486,1161540,1161549,1161584,1162082,1162149,1162169,1162721,1162769,1162836,1162932,1163630,1164419,1164438,1164469,1164480,1164567,1165234,1165247-1165248,1165253,1165273,1165282,1165309,1165331,1165338,1165347,1165360-1165361,1165367-1165368,1165602,1165608,1165677,1165693,1165721,1165723,1165728,1165730,1165738,1165746,1165765,1165777,1165918,1165921,1166077,1166150-1166151,1166290,1166366,1166620,1166686,1166693,1166752,1166757,1167368,1167394,1169447,1170647,1171692,1172233-1172234,1172236,1172269,1172278,1172282,1172556,1172610,1172664,1172689,1172711,1173020-1173021,1173082,1173088,1173090,1173096
 
,1173241,1173256,1173288,1173333,1173342,1173461,1173614,1173630,1173659,1173722,1174061,1174239,1174322,1174325,1174329-1174330,1174337-1174339,1174343,1174353,1174799,1174882,1174884,1174983,1175155,1175158,1175167,1175182,1175190,1175201,1175272,1175275,1175283,1175582,1175589-1175590,1175594,1175602,1175613,1175633,1175690,1175713,1175798,1175889,1175896,1175907,1176584,1176590,1176799,1177050,1177060,1177125,1177152,1177160,1177245,1177850,1177862,1177978,1178209,1178228,1178233,1178449,1178542,1178681,1178684,1178721,1179268,1179274,1180261,1180865,1180891,1180894,1180907,1181028,1181123,1181125,1181136,1181291,1181743,1182796,1183078,1183105,1183142,1183328,1183339-1183340,1183492-1183494,1183605,1184917,1184919,1185018,1185020,1185200,1185588,1185626,1185756,1185758,1186011,1186042-1186045,1186104,1186123,1186137,1186153,1186254,1186257,1186377-1186379,1186479-1186480,1186712,1186743,1186750,1186763,1186890-1186892,1186894,1186949,1187018,1187027-1187028,1187381,1187
 
753,1187755,1187775,1187801,1187806,1187809,1187827,1188301,1188303-1188305,1188399,1188822,1188930-1188931,1189116,1189129,1189183,1189240,1189256,1189386,1189413-1189414,1189477,1189685,1189805,1189857,1189864,1189882,1190034,1190185,1190279,1190339,1190371,1190388-1190389,1190474,1190481,1194915,1195222-1195223,1195531,1195899,1195905,1195943,1195949,1195953,1195955,1195965,1195968,1196175,1196212,1196223,1196304-1196305,1196735,1196825,1196827,1197158,1197261,1197263,1197299-1197300,1197305,1197339-1197340,1197343,1197382,1197386-1197387,1197480,1197578,1198497,1198528,1198552,1198602,1198604,1198607,1198622,1198640,1198696,1198707,1199418,1199432,1199436,1199513,1199529,1199980,1199996,1200056,1200089,1200106-1200107,1200263,1200316,1200320,1200398-1200399,1200445-1200446,1200555,1200627,1200696,1200725,1200937,1200941,1201069,1201087,1201180,1201235-1201237,1201508,1201521,1201542,1201545-1201546,1201548,1201555-1201556,1201568,1201576,1201608,1201921-1201922,1201931,1
 
202035,1202039,1202271,1202565,1202578,1202705,1202828,1202860,1203047-1203052,1203078,1203091,1203253,1203278,1204182,1204856,1204867,1204936,1204938,1204982,1205033,1205065,1205082,1205097,1205112,1206200,1207692,1208046,1208073,1208096,1208114,1208145,1208772,1209194,1209277-1209278
+/tomcat/trunk:1156115,1156171,1156276,1156304,1156519,1156530,1156602,1157015,1157018,1157151,1157198,1157204,1157810,1157832,1157834,1157847,1157908,1157939,1158155,1158160,1158176,1158195,1158198-1158199,1158227,1158331,1158334-1158335,1158426,1160347,1160592,1160611,1160619,1160626,1160639,1160652,1160720-1160721,1160772,1160774,1160776,1161303,1161310,1161322,1161339,1161486,1161540,1161549,1161584,1162082,1162149,1162169,1162721,1162769,1162836,1162932,1163630,1164419,1164438,1164469,1164480,1164567,1165234,1165247-1165248,1165253,1165273,1165282,1165309,1165331,1165338,1165347,1165360-1165361,1165367-1165368,1165602,1165608,1165677,1165693,1165721,1165723,1165728,1165730,1165738,1165746,1165765,1165777,1165918,1165921,1166077,1166150-1166151,1166290,1166366,1166620,1166686,1166693,1166752,1166757,1167368,1167394,1169447,1170647,1171692,1172233-1172234,1172236,1172269,1172278,1172282,1172556,1172610,1172664,1172689,1172711,1173020-1173021,1173082,1173088,1173090,1173096
 
,1173241,1173256,1173288,1173333,1173342,1173461,1173614,1173630,1173659,1173722,1174061,1174239,1174322,1174325,1174329-1174330,1174337-1174339,1174343,1174353,1174799,1174882,1174884,1174983,1175155,1175158,1175167,1175182,1175190,1175201,1175272,1175275,1175283,1175582,1175589-1175590,1175594,1175602,1175613,1175633,1175690,1175713,1175798,1175889,1175896,1175907,1176584,1176590,1176799,1177050,1177060,1177125,1177152,1177160,1177245,1177850,1177862,1177978,1178209,1178228,1178233,1178449,1178542,1178681,1178684,1178721,1179268,1179274,1180261,1180865,1180891,1180894,1180907,1181028,1181123,1181125,1181136,1181291,1181743,1182796,1183078,1183105,1183142,1183328,1183339-1183340,1183492-1183494,1183605,1184917,1184919,1185018,1185020,1185200,1185588,1185626,1185756,1185758,1186011,1186042-1186045,1186104,1186123,1186137,1186153,1186254,1186257,1186377-1186379,1186479-1186480,1186712,1186743,1186750,1186763,1186890-1186892,1186894,1186949,1187018,1187027-1187028,1187381,1187
 
753,1187755,1187775,1187801,1187806,1187809,1187827,1188301,1188303-1188305,1188399,1188822,1188930-1188931,1189116,1189129,1189183,1189240,1189256,1189386,1189413-1189414,1189477,1189685,1189805,1189857,1189864,1189882,1190034,1190185,1190279,1190339,1190371,1190388-1190389,1190474,1190481,1194915,1195222-1195223,1195531,1195899,1195905,1195943,1195949,1195953,1195955,1195965,1195968,1196175,1196212,1196223,1196304-1196305,1196735,1196825,1196827,1197158,1197261,1197263,1197299-1197300,1197305,1197339-1197340,1197343,1197382,1197386-1197387,1197480,1197578,1198497,1198528,1198552,1198602,1198604,1198607,1198622,1198640,1198696,1198707,1199418,1199432,1199436,1199513,1199529,1199980,1199996,1200056,1200089,1200106-1200107,1200263,1200316,1200320,1200398-1200399,1200445-1200446,1200555,1200627,1200696,1200725,1200937,1200941,1201069,1201087,1201180,1201235-1201237,1201508,1201521,1201542,1201545-1201546,1201548,1201555-1201556,1201568,1201576,1201608,1201921-1201922,1201931,1
 
202035,1202039,1202271,1202565,1202578,1202705,1202828,1202860,1203047-1203052,1203078,1203091,1203253,1203278,1204182,1204856,1204867,1204936,1204938,1204982,1205033,1205065,1205082,1205097,1205112,1206200,1207692,1208046,1208073,1208096,1208114,1208145,1208772,1209194,1209277-1209278,1209686-1209731

Modified: tomcat/tc7.0.x/trunk/.gitignore
URL: 
http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/.gitignore?rev=1210012&r1=1210011&r2=1210012&view=diff
==============================================================================
--- tomcat/tc7.0.x/trunk/.gitignore (original)
+++ tomcat/tc7.0.x/trunk/.gitignore Sat Dec  3 21:37:49 2011
@@ -14,7 +14,6 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 # -----------------------------------------------------------------------------
-target
 output
 logs
 work

Modified: 
tomcat/tc7.0.x/trunk/java/org/apache/catalina/core/StandardContext.java
URL: 
http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/java/org/apache/catalina/core/StandardContext.java?rev=1210012&r1=1210011&r2=1210012&view=diff
==============================================================================
--- tomcat/tc7.0.x/trunk/java/org/apache/catalina/core/StandardContext.java 
(original)
+++ tomcat/tc7.0.x/trunk/java/org/apache/catalina/core/StandardContext.java Sat 
Dec  3 21:37:49 2011
@@ -1201,8 +1201,21 @@ public class StandardContext extends Con
                     getName()));
         }
     }
-    
-    
+
+    /**
+     * Add a URL for a JAR that contains static resources in a
+     * META-INF/resources directory that should be included in the static
+     * resources for this context.
+     */
+    public void addResourcesDirContext(DirContext altDirContext) {
+        if (webappResources instanceof BaseDirContext) {
+            ((BaseDirContext) webappResources).addAltDirContext(altDirContext);
+        } else {
+            log.error(sm.getString("standardContext.noResourceJar", 
altDirContext,
+                    getName()));
+        }
+    }
+
     /**
      * Set the current alias configuration. The list of aliases should be of 
the
      * form "/aliasPath1=docBase1,/aliasPath2=docBase2" where aliasPathN must

Modified: 
tomcat/tc7.0.x/trunk/java/org/apache/catalina/loader/WebappClassLoader.java
URL: 
http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/java/org/apache/catalina/loader/WebappClassLoader.java?rev=1210012&r1=1210011&r2=1210012&view=diff
==============================================================================
--- tomcat/tc7.0.x/trunk/java/org/apache/catalina/loader/WebappClassLoader.java 
(original)
+++ tomcat/tc7.0.x/trunk/java/org/apache/catalina/loader/WebappClassLoader.java 
Sat Dec  3 21:37:49 2011
@@ -46,11 +46,11 @@ import java.util.Enumeration;
 import java.util.HashMap;
 import java.util.Iterator;
 import java.util.LinkedHashMap;
+import java.util.LinkedHashSet;
 import java.util.List;
 import java.util.Map;
 import java.util.ResourceBundle;
 import java.util.Set;
-import java.util.Vector;
 import java.util.concurrent.ThreadPoolExecutor;
 import java.util.jar.Attributes;
 import java.util.jar.Attributes.Name;
@@ -1278,7 +1278,8 @@ public class WebappClassLoader
         if (log.isDebugEnabled())
             log.debug("    findResources(" + name + ")");
 
-        Vector<URL> result = new Vector<URL>();
+        //we use a LinkedHashSet instead of a Vector to avoid duplicates with 
virtualmappings
+        LinkedHashSet<URL> result = new LinkedHashSet<URL>();
 
         int jarFilesLength = jarFiles.length;
         int repositoriesLength = repositories.length;
@@ -1291,7 +1292,7 @@ public class WebappClassLoader
             Enumeration<URL> otherResourcePaths = super.findResources(name);
 
             while (otherResourcePaths.hasMoreElements()) {
-                result.addElement(otherResourcePaths.nextElement());
+                result.add(otherResourcePaths.nextElement());
             }
 
         }
@@ -1303,7 +1304,7 @@ public class WebappClassLoader
                 // Note : Not getting an exception here means the resource was
                 // found
                 try {
-                    result.addElement(getURI(new File(files[i], name)));
+                    result.add(getURI(new File(files[i], name)));
                 } catch (MalformedURLException e) {
                     // Ignore
                 }
@@ -1321,7 +1322,7 @@ public class WebappClassLoader
                         try {
                             String jarFakeUrl = 
getURI(jarRealFiles[i]).toString();
                             jarFakeUrl = "jar:" + jarFakeUrl + "!/" + name;
-                            result.addElement(new URL(jarFakeUrl));
+                            result.add(new URL(jarFakeUrl));
                         } catch (MalformedURLException e) {
                             // Ignore
                         }
@@ -1336,12 +1337,24 @@ public class WebappClassLoader
             Enumeration<URL> otherResourcePaths = super.findResources(name);
 
             while (otherResourcePaths.hasMoreElements()) {
-                result.addElement(otherResourcePaths.nextElement());
+                result.add(otherResourcePaths.nextElement());
             }
 
         }
 
-        return result.elements();
+        final Iterator<URL> iterator = result.iterator();
+
+        return new Enumeration<URL>() {
+            @Override
+            public boolean hasMoreElements() {
+                return iterator.hasNext();
+            }
+
+            @Override
+            public URL nextElement() {
+                return iterator.next();
+            }
+        };
 
     }
 

Modified: 
tomcat/tc7.0.x/trunk/java/org/apache/catalina/startup/ContextConfig.java
URL: 
http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/java/org/apache/catalina/startup/ContextConfig.java?rev=1210012&r1=1210011&r2=1210012&view=diff
==============================================================================
--- tomcat/tc7.0.x/trunk/java/org/apache/catalina/startup/ContextConfig.java 
(original)
+++ tomcat/tc7.0.x/trunk/java/org/apache/catalina/startup/ContextConfig.java 
Sat Dec  3 21:37:49 2011
@@ -46,6 +46,9 @@ import java.util.Properties;
 import java.util.Set;
 import java.util.concurrent.ConcurrentHashMap;
 
+import javax.naming.Binding;
+import javax.naming.NamingEnumeration;
+import javax.naming.NamingException;
 import javax.servlet.ServletContainerInitializer;
 import javax.servlet.ServletContext;
 import javax.servlet.annotation.HandlesTypes;
@@ -79,6 +82,7 @@ import org.apache.catalina.util.ContextN
 import org.apache.juli.logging.Log;
 import org.apache.juli.logging.LogFactory;
 import org.apache.naming.resources.DirContextURLConnection;
+import org.apache.naming.resources.FileDirContext;
 import org.apache.naming.resources.ResourceAttributes;
 import org.apache.tomcat.JarScanner;
 import org.apache.tomcat.JarScannerCallback;
@@ -1196,14 +1200,21 @@ public class ContextConfig
                 // Step 4. Process /WEB-INF/classes for annotations
                 // This will add any matching classes to the typeInitializerMap
                 if (ok) {
-                    URL webinfClasses;
                     try {
-                        webinfClasses = 
context.getServletContext().getResource(
-                                "/WEB-INF/classes");
-                        processAnnotationsUrl(webinfClasses, webXml);
-                    } catch (MalformedURLException e) {
+                        NamingEnumeration<Binding> listBindings =
+                            
context.getResources().listBindings("/WEB-INF/classes");
+                        while (listBindings.hasMoreElements()) {
+                            Binding binding = listBindings.nextElement();
+                            if (binding.getObject() instanceof FileDirContext) 
{
+                                File webInfCLassDir =
+                                    new File(
+                                        ((FileDirContext) 
binding.getObject()).getDocBase());
+                                processAnnotationsFile(webInfCLassDir, webXml);
+                            }
+                        }
+                    } catch (NamingException e) {
                         log.error(sm.getString(
-                                "contextConfig.webinfClassesUrl"), e);
+                            "contextConfig.webinfClassesUrl"), e);
                     }
                 }
     
@@ -1565,10 +1576,25 @@ public class ContextConfig
                     if (jar.entryExists("META-INF/resources/")) {
                         context.addResourceJarUrl(url);
                     }
+                } else if ("file".equals(url.getProtocol())) {
+                    FileDirContext fileDirContext = new FileDirContext();
+                    fileDirContext.setDocBase(new 
File(url.toURI()).getAbsolutePath());
+                    try {
+                        fileDirContext.lookup("META-INF/resources/");
+                        //lookup succeeded
+                        if(context instanceof StandardContext){
+                            
((StandardContext)context).addResourcesDirContext(fileDirContext);
+                        }
+                    } catch (NamingException e) {
+                        //not found, ignore
+                    }
                 }
             } catch (IOException ioe) {
                 log.error(sm.getString("contextConfig.resourceJarFail", url,
                         context.getName()));
+            } catch (URISyntaxException e) {
+                log.error(sm.getString("contextConfig.resourceJarFail", url,
+                    context.getName()));
             } finally {
                 if (jar != null) {
                     jar.close();

Modified: 
tomcat/tc7.0.x/trunk/java/org/apache/naming/resources/VirtualDirContext.java
URL: 
http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/java/org/apache/naming/resources/VirtualDirContext.java?rev=1210012&r1=1210011&r2=1210012&view=diff
==============================================================================
--- 
tomcat/tc7.0.x/trunk/java/org/apache/naming/resources/VirtualDirContext.java 
(original)
+++ 
tomcat/tc7.0.x/trunk/java/org/apache/naming/resources/VirtualDirContext.java 
Sat Dec  3 21:37:49 2011
@@ -18,9 +18,11 @@ package org.apache.naming.resources;
 
 import java.io.File;
 import java.util.ArrayList;
-import java.util.Hashtable;
+import java.util.HashMap;
+import java.util.HashSet;
 import java.util.List;
 import java.util.Map;
+import java.util.Set;
 import java.util.StringTokenizer;
 
 import javax.naming.NamingException;
@@ -29,21 +31,21 @@ import javax.naming.directory.Attributes
 import org.apache.naming.NamingEntry;
 
 /**
- * Extended FileDirContext implementation that will allow loading of tld files
- * from the META-INF directory (or subdirectories) in classpath. This will 
fully
- * mimic the behavior of compressed jars also when using unjarred resources. 
Tld
- * files can be loaded indifferently from WEB-INF webapp dir (or subdirs) or
- * from META-INF dir from jars available in the classpath: using this 
DirContext
- * implementation you will be able to use unexpanded jars during development 
and
- * to make any tld in them virtually available to the webapp.
+ * Extended FileDirContext implementation that allows to expose multiple
+ * directories of the filesystem under a single webapp, a feature mainly used
+ * for development with IDEs.
+ * This should be used in conjunction with {@link VirtualWebappLoader}.
  *
  * Sample context xml configuration:
  *
  * <code>
- * &lt;Context docBase="\webapps\mydocbase">
+ * &lt;Context path="/mywebapp" 
docBase="/Users/theuser/mywebapp/src/main/webapp" >
  *   &lt;Resources className="org.apache.naming.resources.VirtualDirContext"
- *              virtualClasspath="\dir\classes;\somedir\somejar.jar"/>
- * &lt;/Resources>
+ *              
extraResourcePaths="/pictures=/Users/theuser/mypictures,/movies=/Users/theuser/mymovies"
 />
+ *   &lt;Loader className="org.apache.catalina.loader.VirtualWebappLoader"
+ *              virtualClasspath="/Users/theuser/mywebapp/target/classes" />
+ *   &lt;JarScanner scanAllDirectories="true" />
+ * &lt;/Context>
  * </code>
  *
  *
@@ -56,32 +58,28 @@ import org.apache.naming.NamingEntry;
  * @version $Id$
  */
 public class VirtualDirContext extends FileDirContext {
+    private String extraResourcePaths = "";
+    private Map<String, List<String>> mappedResourcePaths;
 
     /**
-     * Map containing generated virtual names for tld files under WEB-INF and
-     * the actual file reference.
+     * <p>
+     * Allows to map a path of the filesystem to a path in the webapp. Multiple
+     * filesystem paths can be mapped to the same path in the webapp. 
Filesystem
+     * path and virtual path must be separated by an equal sign. Pairs of paths
+     * must be separated by a comma.
+     * </p>
+     * Example: <code>
+     * 
/=/Users/slaurent/mywebapp/src/main/webapp;/pictures=/Users/slaurent/sharedpictures
+     * </code>
+     * <p>
+     * The path to the docBase must not be added here, otherwise resources 
would
+     * be listed twice.
+     * </p>
+     *
+     * @param path
      */
-    private Map<String, File> virtualMappings;
-
-    /**
-     * Map containing a mapping for tag files that should be loaded from the
-     * META-INF dir of referenced jar files.
-     */
-    private Map<String, File> tagfileMappings;
-
-    /**
-     * <code>;</code> separated list of virtual path elements.
-     */
-    private String virtualClasspath;
-
-    /**
-     * <code>virtualClasspath</code> attribute that will be automatically set
-     * from the <code>Context</code> <code>virtualClasspath</code> attribute
-     * from the context xml file.
-     * @param path <code>;</code> separated list of path elements.
-     */
-    public void setVirtualClasspath(String path) {
-        virtualClasspath = path;
+    public void setExtraResourcePaths(String path) {
+        extraResourcePaths = path;
     }
 
     /**
@@ -91,19 +89,39 @@ public class VirtualDirContext extends F
     public void allocate() {
         super.allocate();
 
-        virtualMappings = new Hashtable<String, File>();
-        tagfileMappings = new Hashtable<String, File>();
-
-        // looks into any META-INF dir found in classpath entries for tld 
files.
-        StringTokenizer tkn = new StringTokenizer(virtualClasspath, ";");
+        mappedResourcePaths = new HashMap<String, List<String>>();
+        StringTokenizer tkn = new StringTokenizer(extraResourcePaths, ",");
         while (tkn.hasMoreTokens()) {
-            File file = new File(tkn.nextToken(), "META-INF");
+            String resSpec = tkn.nextToken();
+            if (resSpec.length() > 0) {
+                int idx = resSpec.indexOf('=');
+                String path;
+                if (idx <= 0) {
+                    path = "";
+                }
+                else {
+                    if (resSpec.startsWith("/=")) {
+                        resSpec = resSpec.substring(1);
+                        idx--;
+                    }
+                    path = resSpec.substring(0, idx);
+                }
+                String dir = resSpec.substring(idx + 1);
+                List<String> resourcePaths = mappedResourcePaths.get(path);
+                if (resourcePaths == null) {
+                    resourcePaths = new ArrayList<String>();
+                    mappedResourcePaths.put(path, resourcePaths);
+                }
+                resourcePaths.add(dir);
 
-            if (!file.exists() || !file.isDirectory()) {
-                continue;
+                // Set allowLinking since there can be no canonical path
+                setAllowLinking(true);
             }
-            scanForTlds(file);
         }
+        if (mappedResourcePaths.isEmpty()) {
+            mappedResourcePaths = null;
+        }
+
     }
 
     /**
@@ -111,48 +129,124 @@ public class VirtualDirContext extends F
      */
     @Override
     public void release() {
+        mappedResourcePaths = null;
+
         super.release();
-        virtualMappings = null;
     }
 
     @Override
     public Attributes getAttributes(String name) throws NamingException {
 
-        // handle "virtual" tlds
-        if (name.startsWith("/WEB-INF/") && name.endsWith(".tld")) {
-            String tldName = name.substring(name.lastIndexOf("/") + 1);
-            if (virtualMappings.containsKey(tldName)) {
-                return new 
FileResourceAttributes(virtualMappings.get(tldName));
-            }
-        } else if (name.startsWith("/META-INF/tags") && name.endsWith(".tag")
-                || name.endsWith(".tagx")) {
+        NamingException initialException;
+        try {
+            // first try the normal processing, if it fails try with extra
+            // resources
+            Attributes attributes = super.getAttributes(name);
+            return attributes;
+        } catch (NamingException exc) {
+            initialException = exc;
+        }
 
-            // already loaded tag file
-            if (tagfileMappings.containsKey(name)) {
-                return new FileResourceAttributes(tagfileMappings.get(name));
+        if (mappedResourcePaths != null) {
+            for (Map.Entry<String, List<String>> mapping : 
mappedResourcePaths.entrySet()) {
+                String path = mapping.getKey();
+                List<String> dirList = mapping.getValue();
+                String resourcesDir = dirList.get(0);
+                if (name.equals(path)) {
+                    File f = new File(resourcesDir);
+                    if (f.exists() && f.canRead()) {
+                        return new FileResourceAttributes(f);
+                    }
+                }
+                path += "/";
+                if (name.startsWith(path)) {
+                    String res = name.substring(path.length());
+                    File f = new File(resourcesDir + "/" + res);
+                    if (f.exists() && f.canRead()) {
+                        return new FileResourceAttributes(f);
+                    }
+                }
             }
+        }
+        throw initialException;
+    }
 
-            // unknown tagfile, search for it in virtualClasspath
-            StringTokenizer tkn = new StringTokenizer(virtualClasspath, ";");
-            while (tkn.hasMoreTokens()) {
-                File file = new File(tkn.nextToken(), name);
-                if (file.exists()) {
-                    tagfileMappings.put(name, file);
-                    return new FileResourceAttributes(file);
+    @Override
+    protected File file(String name) {
+        File file = super.file(name);
+        if (file != null || mappedResourcePaths == null) {
+            return file;
+        }
+        // If not found under docBase, try our other resources
+        // Ensure name string begins with a slash
+        if (name.length() > 0 && name.charAt(0) != '/') {
+            name = "/" + name;
+        }
+        for (Map.Entry<String, List<String>> mapping : 
mappedResourcePaths.entrySet()) {
+            String path = mapping.getKey();
+            List<String> dirList = mapping.getValue();
+            if (name.equals(path)) {
+                for (String resourcesDir : dirList) {
+                    file = new File(resourcesDir);
+                    if (file.exists() && file.canRead()) {
+                        return file;
+                    }
+                }
+            }
+            if (name.startsWith(path + "/")) {
+                String res = name.substring(path.length());
+                for (String resourcesDir : dirList) {
+                    file = new File(resourcesDir, res);
+                    if (file.exists() && file.canRead()) {
+                        return file;
+                    }
                 }
             }
         }
-
-        return super.getAttributes(name);
+        return null;
     }
 
     @Override
     protected List<NamingEntry> list(File file) {
         List<NamingEntry> entries = super.list(file);
 
-        // adds virtual tlds for WEB-INF listing
-        if ("WEB-INF".equals(file.getName())) {
-            entries.addAll(getVirtualNamingEntries());
+        if (mappedResourcePaths != null && !mappedResourcePaths.isEmpty()) {
+            Set<String> entryNames = new HashSet<String>(entries.size());
+            for (NamingEntry entry : entries) {
+                entryNames.add(entry.name);
+            }
+            // Add appropriate entries from the extra resource paths
+            String absPath = file.getAbsolutePath();
+            if (absPath.startsWith(getDocBase() + File.separator)) {
+                String relPath = absPath.substring(getDocBase().length());
+                String fsRelPath = relPath.replace(File.separatorChar, '/');
+                for (Map.Entry<String, List<String>> mapping : 
mappedResourcePaths.entrySet()) {
+                    String path = mapping.getKey();
+                    List<String> dirList = mapping.getValue();
+                    String res = null;
+                    if (fsRelPath.equals(path)) {
+                        res = "";
+                    } else if (fsRelPath.startsWith(path + "/")) {
+                        res = relPath.substring(path.length());
+                    }
+                    if (res != null) {
+                        for (String resourcesDir : dirList) {
+                            File f = new File(resourcesDir, res);
+                            if (f.exists() && f.canRead() && f.isDirectory()) {
+                                List<NamingEntry> virtEntries = super.list(f);
+                                for (NamingEntry entry : virtEntries) {
+                                    // filter duplicate
+                                    if (!entryNames.contains(entry.name)) {
+                                        entryNames.add(entry.name);
+                                        entries.add(entry);
+                                    }
+                                }
+
+                            }
+                        }
+                    }
+                }
+            }
         }
 
         return entries;
@@ -161,65 +255,47 @@ public class VirtualDirContext extends F
     @Override
     protected Object doLookup(String name) {
 
-        // handle "virtual" tlds
-        if (name.startsWith("/WEB-INF/") && name.endsWith(".tld")) {
-            String tldName = name.substring(name.lastIndexOf("/") + 1);
-            if (virtualMappings.containsKey(tldName)) {
-                return new FileResource(virtualMappings.get(tldName));
-            }
-        } else if (name.startsWith("/META-INF/tags") && name.endsWith(".tag")
-                || name.endsWith(".tagx")) {
-
-            // already loaded tag file: we are sure that getAttributes() has
-            // already been called if we are here
-            File tagFile = tagfileMappings.get(name);
-            if (tagFile != null) {
-                return new FileResource(tagFile);
-            }
+        Object retSuper = super.doLookup(name);
+        if (retSuper != null || mappedResourcePaths == null) {
+            return retSuper;
         }
 
-        return super.doLookup(name);
-    }
-
-    /**
-     * Scan a given dir for tld files. Any found tld will be added to the
-     * virtualMappings.
-     * @param dir Dir to scan for tlds
-     */
-    private void scanForTlds(File dir) {
-
-        File[] files = dir.listFiles();
-        for (int j = 0; j < files.length; j++) {
-            File file = files[j];
-
-            if (file.isDirectory()) {
-                scanForTlds(file);
-            } else if (file.getName().endsWith(".tld")) {
-                // just generate a random name using the current timestamp, 
name
-                // doesn't matter since it needs to be referenced by URI
-                String virtualTldName = "~" + System.currentTimeMillis() + "~"
-                        + file.getName();
-                virtualMappings.put(virtualTldName, file);
+        // Perform lookup using the extra resource paths
+        for (Map.Entry<String, List<String>> mapping : 
mappedResourcePaths.entrySet()) {
+            String path = mapping.getKey();
+            List<String> dirList = mapping.getValue();
+            if (name.equals(path)) {
+                for (String resourcesDir : dirList) {
+                    File f = new File(resourcesDir);
+                    if (f.exists() && f.canRead()) {
+                        if (f.isFile()) {
+                            return new FileResource(f);
+                        }
+                        else {
+                            // never goes here, if f is a directory the super
+                            // implementation already returned a value
+                        }
+                    }
+                }
+            }
+            path += "/";
+            if (name.startsWith(path)) {
+                String res = name.substring(path.length());
+                for (String resourcesDir : dirList) {
+                    File f = new File(resourcesDir + "/" + res);
+                    if (f.exists() && f.canRead()) {
+                        if (f.isFile()) {
+                            return new FileResource(f);
+                        }
+                        else {
+                            // never goes here, if f is a directory the super
+                            // implementation already returned a value
+                        }
+                    }
+                }
             }
         }
-
-    }
-
-    /**
-     * Returns a list of virtual naming entries.
-     * @return list of naming entries, containing tlds in virtualMappings
-     */
-    private List<NamingEntry> getVirtualNamingEntries() {
-        List<NamingEntry> virtual = new ArrayList<NamingEntry>();
-
-        for (String name : virtualMappings.keySet()) {
-
-            File file = virtualMappings.get(name);
-            NamingEntry entry = new NamingEntry(name, new FileResource(file),
-                    NamingEntry.ENTRY);
-            virtual.add(entry);
-        }
-        return virtual;
+        return retSuper;
     }
 
 }

Modified: tomcat/tc7.0.x/trunk/webapps/docs/config/context.xml
URL: 
http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/webapps/docs/config/context.xml?rev=1210012&r1=1210011&r2=1210012&view=diff
==============================================================================
--- tomcat/tc7.0.x/trunk/webapps/docs/config/context.xml (original)
+++ tomcat/tc7.0.x/trunk/webapps/docs/config/context.xml Sat Dec  3 21:37:49 
2011
@@ -539,6 +539,8 @@
         <code>docBase</code> instead.</p>
         <p>These external locations will not be emptied if the context
         is un-deployed.</p>
+        <p>A more powerful feature (for development only) is
+        <a href="#Virtual_webapp">Virtual webapp</a>.</p>
       </attribute>
 
       <attribute name="allowLinking" required="false">
@@ -1251,6 +1253,82 @@
 
   </subsection>
 
+  <subsection name="Virtual webapp">
+    <p>During development it may be more productive to avoid copying files 
(static
+    resources, JSPs, classes, jars...) and configure tomcat to use files from 
their
+    source locations. To do that, several customisations of the context 
configuration are
+    required:</p>
+    <ul>
+      <li>The <code>VirtualDirContext</code> implementation of
+      <a href="resources.html">Resources</a></li>
+      <li>The <code>VirtualWebappLoader</code> implementation of
+      <a href="loader.html">Loader</a></li>
+      <li><code>scanAllDirectories="true"</code> on the <a 
href="jar-scanner.html">JarScanner</a></li>
+    </ul>
+    <p>To illustrate this feature, here is an example of a standard maven 
webapp source tree:</p>
+<source>
+mywebapp/
+         src/
+             main/
+                  java/
+                  resources/
+                  webapp/
+                         WEB-INF/
+                                 classes/
+         target/
+                classes/
+</source>
+    <p>To deploy such an application (assuming it also uses the log4j maven 
artefact),
+    the context configuration looks like:</p>
+<source>
+&lt;Context path="/mywebapp" docBase="/Users/theuser/mywebapp/src/main/webapp" 
>
+  &lt;Resources className="org.apache.naming.resources.VirtualDirContext"
+                
extraResourcePaths="/WEB-INF/classes=/Users/theuser/mywebapp/target/classes" />
+  &lt;Loader className="org.apache.catalina.loader.VirtualWebappLoader"
+             
virtualClasspath="/Users/theuser/mywebapp/target/classes;/Users/theuser/.m2/repository/log4j/log4j/1.2.15/log4j-1.2.15.jar"
 />
+  &lt;JarScanner scanAllDirectories="true" />
+&lt;/Context>
+</source>
+
+    <p>Here is another example where the webapp serves pictures under 
/pictures and movies
+    under /movies and also depends on another maven project mylib that would 
normally
+    produce a jar to be packaged in WEB-INF/lib:</p>
+<source>
+mylib/
+      src/
+          main/
+               java/
+               resources/
+                         META-INF/
+                                  resources/
+      target/
+             classes/
+mymovies/
+mypictures/
+mywebapp/
+         src/
+             main/
+                  java/
+                  resources/
+                  webapp/
+                         WEB-INF/
+                                 classes/
+         target/
+                classes/
+</source>
+    <p>The configuration is:</p>
+<source>
+&lt;Context path="/mywebapp" docBase="/Users/theuser/mywebapp/src/main/webapp" 
>
+  &lt;Resources className="org.apache.naming.resources.VirtualDirContext"
+             
extraResourcePaths="/WEB-INF/classes=/Users/theuser/mywebapp/target/classes,/pictures=/Users/theuser/mypictures,/movies=/Users/theuser/mymovies"
 />
+  &lt;Loader className="org.apache.catalina.loader.VirtualWebappLoader"
+             
virtualClasspath="/Users/theuser/mywebapp/target/classes;/Users/theuser/mylib/target/classes;/Users/theuser/.m2/repository/log4j/log4j/1.2.15/log4j-1.2.15.jar"
 />
+  &lt;JarScanner scanAllDirectories="true" />
+&lt;/Context>
+</source>
+    <p>Note that resources in mylib/target/classes/META-INF/resources/ are 
mapped to / as
+    required by servlet 3 specifications.</p>
+  </subsection>
 </section>
 
 

Modified: tomcat/tc7.0.x/trunk/webapps/docs/config/resources.xml
URL: 
http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/webapps/docs/config/resources.xml?rev=1210012&r1=1210011&r2=1210012&view=diff
==============================================================================
--- tomcat/tc7.0.x/trunk/webapps/docs/config/resources.xml (original)
+++ tomcat/tc7.0.x/trunk/webapps/docs/config/resources.xml Sat Dec  3 21:37:49 
2011
@@ -94,6 +94,27 @@
 
   </subsection>
 
+  <subsection name="VirtualDirContext implementation">
+    <p>This implementation of <strong>Resources</strong> is
+    <strong>org.apache.naming.resources.VirtualDirContext</strong> and is 
aimed to be used
+    during development to deploy a webapp without copying files to a webapp 
compliant
+    directory structure.
+    It extends <code>FileDirContext</code> and supports the following
+    additional attributes</p>
+
+    <attributes>
+      <attribute name="extraResourcePaths" required="false">
+        <p>Allows to map a path of the filesystem to a path in the webapp. 
Multiple
+        filesystem paths can be mapped to the same path in the webapp. 
Filesystem
+        path and virtual path must be separated by an equal signe (=). Pairs 
of paths
+        must be separated by a column.</p>
+        Example: 
<code>/=/Users/jdoe/mywebapp/src/main/webapp,/=/Users/jdoe/mywebapp/src/main/webapp2,/pictures=/Users/jdoe/sharedpictures</code>
+        <p>The path to the docBase (as declared in the Context) must not be 
added here.</p>
+        <p>This attribute enhances the feature provided by the 
<code>aliases</code>
+        attribute of the <strong>StandardContext</strong>.</p>
+      </attribute>
+    </attributes>
+  </subsection>
 
 </section>
 



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org

Reply via email to