How can I get a Spring bean injected in my custom Wicket model class?
In a custom Wicket class, not unlike the following, I'm using a service bean which should be injected by Spring, as defined with the SpringBean annotation (from the wicket-spring project). public class ReportExportFileModel extends AbstractReadOnlyModel<File> { @SpringBean(name = "reportService") ReportService reportService; ReportDto reportDto; ReportExportFileModel(ReportDto reportDto) { this.reportDto = reportDto; } @Override public File getObject() { try { return reportService.generatePentahoReport(reportDto); } catch (ReportGenerationException e) { // ... } } } However, this doesn't work: