Bug 300733 - Jars from lib/ext are not visible for my web application

Add section "ext" (as a dynamic section).


git-svn-id: svn+ssh://dev.eclipse.org/svnroot/rt/org.eclipse.jetty/jetty/trunk@1220 7e9141cc-0065-0410-87d8-b60c137991c4
This commit is contained in:
Jan Bartel 2010-01-28 03:18:29 +00:00
parent 6391cbcec7
commit 163b50e119
4 changed files with 42 additions and 6 deletions

View File

@ -18,7 +18,8 @@ jetty-7.0.2-SNAPSHOT
+ JETTY-1151 JETTY-1098 allow UTF-8 with 0 carry bits
+ COMETD-46 reset ContentExchange response content on resend
+ 300178 HttpClients opens too many connections that are immediately closed
+ 300933 - AbstractConnector uses concurrent objects for stats
+ 300733 Jars from lib/ext are not visible for my web application
+ 300933 AbstractConnector uses concurrent objects for stats
jetty-7.0.1.v20091125 25 November 2009
+ 274251 DefaultServlet supports exact match mode.

View File

@ -883,9 +883,8 @@ public class Config
for (File dir : dirs)
{
String id = dir.getName();
if (_classpaths.keySet().contains(id))
continue;
_classpaths.put(id,new Classpath());
if (!_classpaths.keySet().contains(id))
_classpaths.put(id, new Classpath());
dyn_sections.clear();
if (sections!=null)

View File

@ -145,9 +145,10 @@ $(jetty.home)/lib/jetty-client-$(version).jar
[All,websocket]
$(jetty.home)/lib/jetty-websocket-$(version).jar ! available org.eclipse.jetty.websocket.WebSocket
# Add ext if it exists
[All,default,=$(jetty.home)/lib/ext]
[All,default,ext,=$(jetty.home)/lib/ext]
# Add all other sub-directories in /lib/ as options in a dynamic way
[All,=$(jetty.home)/lib/**]

View File

@ -559,4 +559,39 @@ public class ConfigTest extends TestCase
assertEquals("Classpath combined 'server,logging'",expectedCombined,cpCombined);
}
public void testDynamicSection() throws IOException
{
StringBuffer buf = new StringBuffer();
buf.append("[All,default,=$(jetty.home)/lib/ext]\n");
String jettyHome = getTestableJettyHome();
Config options = new Config();
options.setProperty("jetty.home",jettyHome);
options.parse(buf);
Classpath defaultClasspath = options.getClasspath();
assertNotNull("Default Classpath should not be null",defaultClasspath);
Classpath foocp = options.getSectionClasspath("Foo");
assertNull("Foo Classpath should not exist",foocp);
Classpath allcp = options.getSectionClasspath("All");
assertNotNull("Classpath section 'All' should exist",allcp);
Classpath extcp = options.getSectionClasspath("ext");
assertNotNull("Classpath section 'ext' should exist", extcp);
File lib = new File(getJettyHomeDir(),"lib");
File ext = new File(lib, "ext");
Classpath expected = new Classpath();
expected.addComponent(new File(ext,"custom-impl.jar"));
assertEquals("Single Classpath Section",expected,extcp);
}
}