Hello. I have such a trivial question. In the spring, it is possible to raise the context by simply passing the xml
and bins to the annotation in a similar way:
@RunWith(SpringJUnit4ClassRunner.class) @ContextConfiguration(locations = {"/my-config.xml"}).
This is used to run JUnit
tests. The question is - can this be done for a normal application, not JUnit
, that is, without writing java-кода
with creating a class that stores ClassPathXmlApplicationContext
? That is, create a context immediately from xml
, and then drive @Required
, @Autowired
.