Я использую NanoHTTPD
RouterNanoHTTPD
, чтобы добавить сопоставления маршрутов.
Вызов addRoute(String uri, Class<?> handler, Object ... params)
не вызывает параметризованный конструктор для создания экземпляра объекта Class<?> handler
. Кто-нибудь смог это сделать?
Проблема точно такая же, как и в этом выпуске Github NanoHTTPD .
public class SoapServer extends RouterNanoHTTPD {
@Override
public void addMappings() {
super.addMappings();
// works fine when there are no parameters passed
addRoute("/onvif/device_service", DeviceServiceHandler.class);
// MediaServiceHandler instantiated with empty constructor;
// it doesn't create the class with these arguments in the constructor
addRoute("/onvif/media_service", MediaServiceHandler.class,
systemServices, userRepository, authenticators);
}