I am having trouble injecting a service into a custom tag I created:
@Configurable
public MyTag extends BodyTagSupport{
@Autowired
private MyService service;
@Override
public int doStartTag(){
......
service.callServiceMethod(); // service is null
....
}
.......
}
Is there a way to inject beans using @Configurable in Custom Tags? I do not want to use following approach to inject beans:
ServletContext sc = ((PageContext) getJspContext()).getServletContext();
ApplicationContext context =
WebApplicationContextUtils.getWebApplicationContext(sc);