1
In meiner Ninja Web Application habe ich einen generischen Controller für CRUD-Betrieb.Ninjaframework MVC Controller Vererbung und Routing
Generic Interface:
interface GenericCrudController <T, PK> {
Result read(PK id);
}
Zusammenfassung Controller:
abstract class AbstractCrudController<T, PK extends Serializable> implements GenericCrudController<T, PK>{
@Override
public Result read(PK id) {
return null;
}
}
Foo Controller:
@Singleton
@Path("/foo")
public class FooController extends AbstractCrudController<FooDto, Long>{
@Path("/{id}")
@GET
@Override
public Result read(@PathParam("id") Long id) {
}
}
Wenn ich meine ninja Webapp laufen, dieser Fehler aufgetreten:
[NinjaJetty] ERROR ninja.RouteBuilder - Error in route configuration!!!
[NinjaJetty] ERROR ninja.RouteBuilder - Can not find Controller controllers.FooController and method read
[NinjaJetty] ERROR ninja.RouteBuilder - Hint: make sure the controller returns a ninja.Result!
[NinjaJetty] ERROR ninja.RouteBuilder - Hint: Ninja does not allow more than one method with the same name!
[NinjaJetty] ERROR ninja.RouteBuilder - Error in route configuration!!!
[NinjaJetty] ERROR ninja.RouteBuilder - Can not find Controller controllers.FooController and method read
[NinjaJetty] ERROR ninja.RouteBuilder - Hint: make sure the controller returns a ninja.Result!
[NinjaJetty] ERROR ninja.RouteBuilder - Hint: Ninja does not allow more than one method with the same name!
[NinjaJetty] ERROR ninja.RouteBuilder - Can not find Controller controllers.FooController and method read
[NinjaJetty] ERROR ninja.RouteBuilder - Hint: make sure the controller returns a ninja.Result!
[NinjaJetty] ERROR ninja.RouteBuilder - Hint: Ninja does not allow more than one method with the same name!
danke im voraus