I always have a question from the first day I used spring. If a class has a constructor that needs two parameters, but these 2 parameters are not fixed, they are generated according to the input request, each time they are different, but I need a spring container to control the class instance, how to do it in spring ? for instance
Class A{ A(int x,int y){
but x and y are not fixed, we need to calculate x and y by our program, then we can create an instance for A in regular java code, for example below
int x=calculate(request); int y=calculate(request); A a=new A(x,y);
But how to make spring control the instantiation of class A?
More info: Why do I need a spring-driven class A because A depends on some other classes that spring manages.
Neo source share