// explicitly-defined virtual hosts, most specific
list=hosts.get(host);
for (int j=0; j<LazyList.size(list); j++)
{
Handler handler = (Handler)LazyList.get(list,j);
handler.handle(target,request, response, dispatch);
if (base_request.isHandled())
return;
}
// wildcard for one level of names
list=hosts.get("*."+host.substring(host.indexOf(".")+1));
for (int j=0; j<LazyList.size(list); j++)
{
Handler handler = (Handler)LazyList.get(list,j);
handler.handle(target,request, response, dispatch);
if (base_request.isHandled())
return;
}
// no virtualhosts defined for the context, least specific
// will handle any request that does not match to a specific virtual host above
list=hosts.get("*");
for (int j=0; j<LazyList.size(list); j++)
{
Handler handler = (Handler)LazyList.get(list,j);
handler.handle(target,request, response, dispatch);
if (base_request.isHandled())
return;
}
}
else
{
for (int j=0; j<LazyList.size(list); j++)
{
Handler handler = (Handler)LazyList.get(list,j);
handler.handle(target,request, response, dispatch);
if (base_request.isHandled())
return;
}
}
}