I have a java-spring application. I use jersey client for some connections to third-party services. I do not use other jersey features (such as features for restfull-services building etc.)
Do I use dependency injection for creating of com.sun.jersey.api.client.Client? (jersey-spring.jar) Or should I call
Client client = Client.create();
each time when I need to use it?
Thanks for advice.
UPDATE: Solution for java-based configuration:
We can define the bean:
@Bean
public Client mailClient() {
return Client.create();
}
Then we can use it:
@Autowired
private Client mailClient;