how to set an application context constructor with an array

how to set an application context constructor with an array

Discuss the source code and development of Spring Engine in general from a technical point of view. Patches go here too.

Moderator: Moderators

Post Reply
nbootwala
Posts: 1
Joined: 07 Aug 2008, 15:54

how to set an application context constructor with an array

Post by nbootwala »

Hello,

I am trying to set paths of multiple xml files using FileSystemXmlApplicationContext

e.g .
private static ApplicationContext context;
private static InterFace1 bean1;
private static Interface2 bean2;

String filePaths[] = {"C:/...../config/app-context/file1.xml",""C:/...../config/app-context/file2.xml"};
context = new FileSystemXmlApplicationContext(filePaths);

bean1 = (InterFace1) context.getBean("bean1"); (This bean should get identified from the file1.xml)
bean2 = (InterFace2) context.getBean("bean2"); (This bean should get identifed from the file2.xml)

I tried to make it work but it gives me error "Caused by: java.io.FileNotFoundException: WEB-INF\config\*.properties (The system cannot find the path specified)"

does any one have any clue what is wrong with the code?

Thanks
User avatar
koshi
Lobby Developer
Posts: 1059
Joined: 14 Aug 2007, 16:15

Re: how to set an application context constructor with an array

Post by koshi »

i'm somewhat stumped as to how someone would mistake this board to be connected to http://en.wikipedia.org/wiki/Spring_Framework
User avatar
aegis
Posts: 2456
Joined: 11 Jul 2007, 17:47

Re: how to set an application context constructor with an array

Post by aegis »

does java get all pissy over / vs \ in paths?


you're probably looking for this site though
User avatar
AF
AI Developer
Posts: 20687
Joined: 14 Sep 2004, 11:32

Re: how to set an application context constructor with an array

Post by AF »

no I wouldnt think so but it does need escaping
User avatar
koshi
Lobby Developer
Posts: 1059
Joined: 14 Aug 2007, 16:15

Re: how to set an application context constructor with an array

Post by koshi »

using /,\ directly is no way to go in any case, java api provides sth like GetPathSeperator, so he should use it, no?
User avatar
ILMTitan
Spring Developer
Posts: 410
Joined: 13 Nov 2004, 08:35

Re: how to set an application context constructor with an array

Post by ILMTitan »

koshi wrote:using /,\ directly is no way to go in any case, java api provides sth like GetPathSeperator, so he should use it, no?
My thoughts exactly.
User avatar
Erom
Posts: 1115
Joined: 25 Apr 2006, 05:08

Re: how to set an application context constructor with an array

Post by Erom »

koshi wrote:java api provides sth like GetPathSeperator,
What does sth mean in this context? I can't seem to find it.
User avatar
koshi
Lobby Developer
Posts: 1059
Joined: 14 Aug 2007, 16:15

Re: how to set an application context constructor with an array

Post by koshi »

something
Post Reply

Return to “Engine”