HttpRequestHandlerChain handlerchain = new HttpRequestHandlerChain();
handlerchain.appendHandler(new AuthRequestHandler(creds, "test2"));
handlerchain.appendHandler(new HttpServiceHandler(new FeedbackService()));
HttpState state = new HttpState();
AuthScope realm1 = new AuthScope(
this.server.getLocalAddress(),
this.server.getLocalPort(),
"test");
AuthScope realm2 = new AuthScope(
this.server.getLocalAddress(),
this.server.getLocalPort(),
"test2");
state.setCredentials(realm1, new UsernamePasswordCredentials("testuser","testpass"));
state.setCredentials(realm2, new UsernamePasswordCredentials("testuser2","testpass2"));
this.client.setState(state);
this.server.setRequestHandler(handlerchain);
GetMethod httpget = new GetMethod("/test2/");