Re: [Simpleweb-Support] PatternMapper load from classpath
Brought to you by:
niallg
From: Padraic R. <pre...@cs...> - 2005-05-18 04:41:26
|
Just tried that... Doesn't work. But it got me closer... Issue seems to be that PatternMapper acquires the mapper.properties file=20 via getFile() and/or getLocation and not getProperties(). Overriding getFile did the trick. public File getFile(String name) throws LocateException { URL url =3D this.getClass().getClassLoader().getResource(name); if (url !=3D null) { String path =3D url.toExternalForm(); if (path.startsWith("file:")) { return new File(path.substring(5)); } } return super.getFile(name); }=A8 Thanks. Niall Gallagher <gallagher=5F...@ya...> Sent by: sim...@li... 05/17/2005 02:40 PM Please respond to simpleweb-support =20 To: sim...@li... cc:=20 Subject: Re: [Simpleweb-Support] PatternMapper load from cla= sspath Hi Padraic, Subclass the Context object and re-write the getLocator so that it acquires the properties from the classpath. Done! Niall --- Padraic Renaghan <pre...@cs...> wrote: > What is the best way for me to get PatternMapper to > load mapper.properties > from the classpath? > I thought about extending it, but its all final and > private. > Other ideas? >=20 > Thanks, > Padraic >=20 >=20 >=20 > ------------------------------------------------------- > This SF.Net email is sponsored by Oracle Space > Sweepstakes > Want to be the first software developer in space? > Enter now for the Oracle Space Sweepstakes! > http://ads.osdn.com/?ad=5Fid=3D7412&alloc=5Fid=3D16344&op=3Dclick > =5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F= =5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F > Simpleweb-Support mailing list > Sim...@li... > https://lists.sourceforge.net/lists/listinfo/simpleweb-support >=20 Niall Gallagher =20 =5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F= =5F=5F=5F=5F=5F=5F=5F=5F=5F=20 Do you Yahoo!?=20 Yahoo! Mail - now with 250MB free storage. Learn more.=20 http://info.mail.yahoo.com/mail=5F250 ------------------------------------------------------- This SF.Net email is sponsored by Oracle Space Sweepstakes Want to be the first software developer in space? Enter now for the Oracle Space Sweepstakes! http://ads.osdn.com/?ad=5Fid=3D7412&alloc=5Fid=3D16344&op=3Dclick =5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F= =5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F Simpleweb-Support mailing list Sim...@li... https://lists.sourceforge.net/lists/listinfo/simpleweb-support |