Refactor servlet handling to avoid isVhost() check