Link to home
Start Free TrialLog in
Avatar of Rohit Bajaj
Rohit BajajFlag for India

asked on

Are there any issues with Autowiring a Controller Object into other @Component class

Hi,
I have a class in which i am Autowiring a controller object like this :

@Component
public class Test {

@Autowired
XController xController;


public String method() {
    return xController.method();
}

Are there any issues with this approach as generally i dont see any controller object autowired anywhere..
Thanks
ASKER CERTIFIED SOLUTION
Avatar of gurpsbassi
gurpsbassi
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial