Skip to content

Remove pippo-spring module from next major version of Pippo  #565

Description

@decebals

The idea is that I used with success another, more natural approach.
First of all I injected the needed services directly in Controller class:

importorg.springframework.beans.factory.annotation.Autowired;
importorg.springframework.stereotype.Component;
importro.pippo.controller.Controller;
importro.pippo.controller.Path;
@Path("/clients")
@ComponentpublicclassClientControllerextendsController {
@AutowiredprivateSubscriptionServicesubscriptionService;
@AutowiredprivateClientServiceclientService;
// GET, POST methods
}

Add all controllers in Application after they were collected by Spring:

importorg.springframework.stereotype.Component;
importro.pippo.controller.ControllerApplication;
@ComponentpublicclassMyApplicationextendsControllerApplication {
@AutowiredprivateList<? extendsController> controllers;
@OverrideprotectedvoidonInit() {
addControllers(controllers.toArray(newController[controllers.size()]));
}
}

The content of this issue is related somehow with #538.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions