According to the servlet spec getRealPath() will always return null if the web application is executing in an non-unpacked war. So, in general this is not an option for a servlet or any j2ee application.
LES -----Original Message----- From: Pat Lightbody [mailto:[EMAIL PROTECTED] Sent: Wednesday, June 11, 2003 5:19 PM To: [EMAIL PROTECTED] Subject: Re: [OS-webwork] Configuration in /WEB-INF Isn't getRealPath() deprecated though? -Pat ----- Original Message ----- From: "Mathias Bogaert" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Wednesday, June 11, 2003 2:06 PM Subject: Re: [OS-webwork] Configuration in /WEB-INF > This is exactly the way SiteMesh does it. Have a look at the ConfigLoader. > > Cheers, > Mathias > > ----- Original Message ----- > From: "Anthony Eden" <[EMAIL PROTECTED]> > To: <[EMAIL PROTECTED]> > Sent: Wednesday, June 11, 2003 10:44 PM > Subject: Re: [OS-webwork] Configuration in /WEB-INF > > > > There is an interesting problem with using the ClassLoader or the > > ServletContext for getting resource data: there is no way using the APIs > > to determine if the resource has been modified. > > > > One workaround is to check the getRealPath() method to see if it is > > available and use it if it is to build a real file object which you can > > use to determine the last modified date. Another possibility is to > > specify a reload interval for the resource. > > > > Does XWork (and/or WW2) provide either of these methods for reloading > > configuration resources? > > > > -Anthony > > > > [EMAIL PROTECTED] wrote: > > > Ah, I see. That makes sense. So, you are doing it based on the servlet > > > context class loader. Kewl, glad to learn that. > > > > > > LES > > > > > > -----Original Message----- > > > From: Anthony Eden [mailto:[EMAIL PROTECTED] > > > Sent: Wednesday, June 11, 2003 2:54 PM > > > To: [EMAIL PROTECTED] > > > Subject: Re: [OS-webwork] Configuration in /WEB-INF > > > > > > You don't need to open an HTTP connection, rather you can get the > > > InputStream directly from the servlet context: > > > > > > InputStream in = > > > servletContext.getResourceAsStream("/WEB-INF/xwork.xml"); > > > > > > Sincerely, > > > Anthony Eden > > > > > > [EMAIL PROTECTED] wrote: > > > > > >>I may just be confused or have missed something, but does getResource > > >>not just give you the path relative to the doc root? Will you then > > > > > > open > > > > > >>it using http? Normally, would you not secure your web-inf from url > > >>access(for security reasons)? Or is there another method that would > > >>allow you to actually use File (by getting the servlets "realpath")? > > >> > > >>LES > > >> > > >>-----Original Message----- > > >>From: Hani Suleiman [mailto:[EMAIL PROTECTED] > > >>Sent: Tuesday, June 10, 2003 9:44 PM > > >>To: [EMAIL PROTECTED] > > >>Subject: Re: [OS-webwork] Configuration in /WEB-INF > > >> > > >>getRealPath is very bad, what's so wrong with > > >>servletContext.getResource() though? > > >> > > >>On Tuesday, June 10, 2003, at 06:59 PM, [EMAIL PROTECTED] > > > > > > wrote: > > > > > >> > > >>>The hardest problem with that is that you can't use > > >>>context.getRealPath() to get the location of WEB-INF in an unpacked > > >> > > >>war > > >> > > >> > > >>>config (per servlet spec). Honestly, classpath is usually the best > > >>>solution. > > >>> > > >>>-----Original Message----- > > >>>From: Mathias Bogaert [mailto:[EMAIL PROTECTED] > > >>>Sent: Tuesday, June 10, 2003 6:55 PM > > >>>To: [EMAIL PROTECTED] > > >>>Subject: [OS-webwork] Configuration in /WEB-INF > > >>> > > >>>Guys, > > >>> > > >>>It seems like we are having a lot of problems with finding > > >>>configuration > > >>>files in the classpath etc. Also, I dislike putting configuration > > >> > > >>files > > >> > > >> > > >>>other than .properties on the classpath. That's why I propose putting > > >>>it > > >>>all > > >>>(components.xml, xwork.xml etc)under /WEB-INF directly (same as > > >>>SiteMesh > > >>>for > > >>>example). > > >>> > > >>>+1 from me > > >>> > > >>>Mathias > > >>> > > >>> > > >>> > > >>>------------------------------------------------------- > > >>>This SF.net email is sponsored by: Etnus, makers of TotalView, The > > >>>best > > >>>thread debugger on the planet. Designed with thread debugging features > > >>>you've never dreamed of, try TotalView 6 free at www.etnus.com. > > >>>_______________________________________________ > > >>>Opensymphony-webwork mailing list > > >>>[EMAIL PROTECTED] > > >>>https://lists.sourceforge.net/lists/listinfo/opensymphony-webwork > > >>> > > >>> > > >>>------------------------------------------------------- > > >>>This SF.net email is sponsored by: Etnus, makers of TotalView, The > > >>>best > > >>>thread debugger on the planet. Designed with thread debugging features > > >>>you've never dreamed of, try TotalView 6 free at www.etnus.com. > > >>>_______________________________________________ > > >>>Opensymphony-webwork mailing list > > >>>[EMAIL PROTECTED] > > >>>https://lists.sourceforge.net/lists/listinfo/opensymphony-webwork > > >>> > > >> > > >> > > >> > > >> > > >>------------------------------------------------------- > > >>This SF.NET email is sponsored by: eBay > > >>Great deals on office technology -- on eBay now! Click here: > > >>http://adfarm.mediaplex.com/ad/ck/711-11697-6916-5 > > >>_______________________________________________ > > >>Opensymphony-webwork mailing list > > >>[EMAIL PROTECTED] > > >>https://lists.sourceforge.net/lists/listinfo/opensymphony-webwork > > >> > > >> > > >>------------------------------------------------------- > > >>This SF.NET email is sponsored by: eBay > > >>Great deals on office technology -- on eBay now! Click here: > > >>http://adfarm.mediaplex.com/ad/ck/711-11697-6916-5 > > >>_______________________________________________ > > >>Opensymphony-webwork mailing list > > >>[EMAIL PROTECTED] > > >>https://lists.sourceforge.net/lists/listinfo/opensymphony-webwork > > > > > > > > > > > > > > > ------------------------------------------------------- > > > This SF.NET email is sponsored by: eBay > > > Great deals on office technology -- on eBay now! Click here: > > > http://adfarm.mediaplex.com/ad/ck/711-11697-6916-5 > > > _______________________________________________ > > > Opensymphony-webwork mailing list > > > [EMAIL PROTECTED] > > > https://lists.sourceforge.net/lists/listinfo/opensymphony-webwork > > > > > > > > > ------------------------------------------------------- > > > This SF.NET email is sponsored by: eBay > > > Great deals on office technology -- on eBay now! Click here: > > > http://adfarm.mediaplex.com/ad/ck/711-11697-6916-5 > > > _______________________________________________ > > > Opensymphony-webwork mailing list > > > [EMAIL PROTECTED] > > > https://lists.sourceforge.net/lists/listinfo/opensymphony-webwork > > > > > > > > ------------------------------------------------------- > > This SF.NET email is sponsored by: eBay > > Great deals on office technology -- on eBay now! Click here: > > http://adfarm.mediaplex.com/ad/ck/711-11697-6916-5 > > _______________________________________________ > > Opensymphony-webwork mailing list > > [EMAIL PROTECTED] > > https://lists.sourceforge.net/lists/listinfo/opensymphony-webwork > > > > > > > > ------------------------------------------------------- > This SF.NET email is sponsored by: eBay > Great deals on office technology -- on eBay now! Click here: > http://adfarm.mediaplex.com/ad/ck/711-11697-6916-5 > _______________________________________________ > Opensymphony-webwork mailing list > [EMAIL PROTECTED] > https://lists.sourceforge.net/lists/listinfo/opensymphony-webwork ------------------------------------------------------- This SF.NET email is sponsored by: eBay Great deals on office technology -- on eBay now! Click here: http://adfarm.mediaplex.com/ad/ck/711-11697-6916-5 _______________________________________________ Opensymphony-webwork mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/opensymphony-webwork ------------------------------------------------------- This SF.NET email is sponsored by: eBay Great deals on office technology -- on eBay now! Click here: http://adfarm.mediaplex.com/ad/ck/711-11697-6916-5 _______________________________________________ Opensymphony-webwork mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/opensymphony-webwork