package example.jetty;

import org.mortbay.jetty.Server;
import org.mortbay.jetty.webapp.WebAppContext;

import java.util.ArrayList;
import java.util.Collections;
import java.util.Iterator;
import java.util.List;

public class WebServer {

    private Server server;

    public WebServer(int port) {
        server = new Server(port);
    }

    public WebServer start() throws Exception {
        WebAppContext context = new WebAppContext("src/webapp", "/example");
        context.setConfigurationClasses(removeTagLibConfiguration(context));

        server.addHandler(context);
        server.start();
        return this;
    }

    public void stop() {
        try {
            server.stop();
        } catch (Exception e) {
            e.printStackTrace();
        }
    }

    public static void main(String[] args) throws Exception {
        new WebServer(8080).start();
    }

    private String[] removeTagLibConfiguration(WebAppContext context) {
        List<String> configurationClasses = new ArrayList<String>();
        Collections.addAll(configurationClasses, context.getConfigurationClasses());
        Iterator<String> itr = configurationClasses.iterator();
        while (itr.hasNext()) {
            if (itr.next().endsWith("TagLibConfiguration")) {
                itr.remove();
            }
        }
        return configurationClasses.toArray(new String[configurationClasses.size()]);
    }
}

@@ -119,36 +119,57 @@
 til.
-Array
 List;%0A
+%0A
 import 
-java.util.
+static ch.lambdaj.collection.Lambda
 Coll
@@ -175,16 +175,21 @@
 lections
+.with
 ;%0Aimport
@@ -193,49 +193,45 @@
 ort 
-java.util.Iterator;%0Aimport java.util.List
+static org.hamcrest.Matchers.endsWith
 ;%0A%0Ap
@@ -560,17 +560,16 @@
 text));%0A
-%0A
         
@@ -1012,339 +1012,91 @@
 tion
-Classes = new ArrayList%3CString%3E();%0A        Collections.addAll(configurationClasses, context.getConfigurationClasses());%0A        Iterator%3CString%3E itr = configurationClasses.iterator();%0A        while (itr.hasNext()) %7B%0A            if (itr.next().endsWith(%22TagLibConfiguration%22)) %7B%0A                itr.remove();%0A            %7D%0A        %7D
+ = with(context.getConfigurationClasses()).remove(endsWith(%22TagLibConfiguration%22));
 %0A   
@@ -1120,23 +1120,16 @@
 guration
-Classes
 .toArray
@@ -1153,23 +1153,16 @@
 guration
-Classes
 .size()%5D

use Lambdaj for array filtering