Spring ApplicationContext

Generic1

Top Contributor
Hallo,

ich steh gerade auf der Leitung, ich habe eine "normale" Java- Anwendung programmiert (also keine Webanwendung) und da habe ich den Spring context so geladen:

Code:
final ApplicationContext ctx = new FileSystemXmlApplicationContext("src/service.xml");
final IParticipantRepository pR = (ParticipantRepository) ctx.getBean("participantDao");

In meiner Web- Applikation habe ich jetzt die Datei service.xml so geladen:

Code:
<context-param>
        <param-name>contextConfigLocation</param-name>
        <param-value>
            /WEB-INF/applicationContext.xml
            /WEB-INF/service.xml
        </param-value>
    </context-param>

Also geladen ist jetzt die service- Datei, aber wie greife ich jetzt auf auf den ApplicationContect zu also was muss ich in der Webapplikation statt

Code:
final ApplicationContext ctx = new FileSystemXmlApplicationContext("src/service.xml");

schreiben damit ich ctx habe?
Besten Dank,
lg
 

Neue Themen


Zurück
Oben