At 09:11 23.01.00 , you wrote:
>Hey
>
>Ahh, one of my favourite problems. Here's two neat ways to get paths in
>Java without hardcoding them:
>* Get the location of "this" by doing
>this.getClass().getProtectionDomain().getCodeSource().getLocation().
>This will give you the location of the class. Do this in the bean to
>get the location of the beans class. I know you wanted the servlets
>location, but maybe you can use this instead.
>* I sometimes place "dummy" files in the classpath and do new
>File(getClass().getResource("/dummy.tmp").getFile()).getParent(), which
>gives me the directory where the dummy.tmp file has been placed within
>the classpath. That way I can move the dummy file and the app will
>automatically be "reconfigured" to use the new location.
>
>HopeThisHelps :-)
sure does :-). thanks. as several times before you made my day.
BTW when will your book be out?
robert
>/Rickard
(-) Robert Kr�ger
(-) SIGNAL 7 Gesellschaft f�r Informationstechnologie mbH
(-) Br�der-Knau�-Str. 79 - 64285 Darmstadt,
(-) Tel: 06151 665401, Fax: 06151 665373
(-) [EMAIL PROTECTED], www.signal7.de
===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff EJB-INTEREST". For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".