Hi!

I am using the HTTPService to register a custom servlet based:
------------------------------------------------------------------------------------------------------------------------------------------------------
/**
* The {...@link LogService} service.
*/
@Requires
private LogService logService;

/**
* The {...@link EventAdmin} service.
*/
@Requires
private EventAdmin eventAdminService;

@Validate
public void start() {
Dictionary<String, String> properties = new Hashtable<String, String>();
        properties.put("org.custom.servlet", CustomServlet.class.getName());
httpService.registerServlet(alias, new ServerServlet(), properties, null);
}
------------------------------------------------------------------------------------------------------------------------------------------------------


My CustomServlet class requires a couple of services:
------------------------------------------------------------------------------------------------------------------------------------------------------
public class CustomServlet extends Application {
        
        /**
         * The {...@link LogService} service.
         */
        private LogService logService;

        /**
         * The {...@link EventAdmin} service.
         */
        private EventAdmin eventAdminService;
.............................................
------------------------------------------------------------------------------------------------------------------------------------------------------

I tried putting LogService and EventAdmin as static fields, in the iPojo class, but did not work. Any suggestions what would be the easiest way to pass them?

Thanks!

Regards,
Vlatko

Reply via email to