Код: Выделить всё
@Lazy
@Controller
@RequestMapping("/Portability4CtRestService")
public class Portability4CtRestService extends AbstractP4CtRestService {
private P4CtAccountRoutingService accountRoutingService;
/**
* @param accountRoutingService the accountRoutingService to set
*/
@Autowired
public void setAccountRoutingService(P4CtAccountRoutingService p4ctAccountRoutingService) {
this.accountRoutingService = p4ctAccountRoutingService;
}
@RequestMapping(value = "/searchAccountRouting", method = RequestMethod.POST, consumes = { "application/json" }, produces = { "application/json" })
public @ResponseBody
String searchAccountRouting(HttpServletRequest request) {
//do something with accountRoutingService....
}
}
Код: Выделить всё
@Autowired
private P4CtAccountRoutingService accountRoutingService;
or
@Resources
private P4CtAccountRoutingService accountRoutingService;
Код: Выделить всё
public Portability4CtRestService() {
setAccountRoutingService((P4CtAccountRoutingService) it.vtfinance.vtpie.core.configuration.spring.ContextSupport.getContext().getBean(P4CtAccountRoutingService.BEAN_NAME));
}
Подробнее здесь: https://stackoverflow.com/questions/787 ... controller