TestController.java
@RestController
public class TestController {
@Autowired
private TestClass testClass;
@RequestMapping(value = \"/test\", method
You cannot autowire prototype bean (well, you can but the bean will be always the same)... autowire the ApplicationContext and get an instance of the needed prototype bean manually (for example in the constructor):
TestClass test = (TestClass) context.getBean("nameOfTestClassBeanInConfiguration");
In this way you're sure of getting a new instance of TestClass.