On Tue, 11 Feb 2003, Pete Serafin wrote:

> Date: Tue, 11 Feb 2003 10:49:11 -0600
> From: Pete Serafin <[EMAIL PROTECTED]>
> Reply-To: Struts Users Mailing List <[EMAIL PROTECTED]>
> To: Struts Users Mailing List <[EMAIL PROTECTED]>
> Subject: How to access ApplicationProperties elements???
>
> All,
>
> I am having trouble remembering how to get access to the
> ApplicationProperties.conf file from within my Action classes.  I need
> to be able to get to some of the elements within this file for
> generating messages to be displayed in my view, but cant find any
> examples on how to do this.  TIA
>

Where do you want to store this file?

The most common place for stuff like this is in the /WEB-INF directory, to
take advantage of the fact that the servlet container will prevent a
browser from trying to access it directly.  If you do that, read it from
an Action like this:

  InputStream is =
    getServlet().getServletContext().getResourceAsStream
     ("/WEB-INF/ApplicationProperties.conf");

>
> Pete Serafin
>

Craig


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to