> Figured it out! I also found it to be a very cool way of providing
> property files for web-apps and have them deployed with the application
> (under WEB-INF/properties).
Cool. I use getContextPath() in my stuff to pick up the WEB-INF dir too.
Course it only works when deployed under 2.2 :-)
> You use the following to read from a file programmatically within a
servlet:
>
> ServletContext sc = this.getServletContext();
> InputStream is_xml =
sc.getResourceAsStream("WEB-INF/guidelines/Headache.xml");
>
> One odd thing with JRun3:
> The sc.getContextPath() returns "/approot" without the second slash.
> Not sure why I don't need a /WEB-INF when using getResourceAsStream()
> but it wouldn't work that way. It seems to add the second slash. The
> specification only states that it must start with a slash, so there
> is some vagueness in the spec:
Hmm, I'm confused. You say you _don't_ need /WEB-INF when using
getResourceAsStream(), but you show it in your example above. Typo?
Cheers
Geoff
------------------------------------------------------------------------------
Archives: http://www.egroups.com/group/jrun-interest/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/jrun_talk
or send a message to [EMAIL PROTECTED] with 'unsubscribe' in the
body.