What do you mean by "the server's environment"? What do you mean by your
"various settings"?

You can get the system properties with System.getProperties/getProperty. I
use system properties to pass external configuration information to my
Restlet component, whether it's running standalone or embedded in a WAR as
a servlet.

System properties are the *only* way to pass such information to Amazon
Elastic Beanstalk apps -- in fact, Beanstalk is limited to a fixed set of
environment variables -- so it's important for me not to depend on other
external information in order to keep my component as portable as
possible. I describe some of the details of making this work in a blog
entry<http://tembrel.blogspot.com/2012/01/deploying-restlet-components-in-elastic.html>.
It makes heavy use of third-party libraries Guice, Guava, and Rocoto, but
the principle is the same even if you don't use them.

--tim

On Mon, Feb 6, 2012 at 5:20 PM, John Wismar <[email protected]>wrote:

> Hey, all-****
>
> ** **
>
> (I’m using Restlet JEE 2.x, Tomcat7, JavaSE7.) I have my app running as a
> servlet in Tomcat. Ideally, I would like to be able to copy the .war file
> from one environment to another without recompiling or repackaging. I’m
> trying to figure out how to retrieve information from outside the WAR,
> whether it be from that Tomcat instance’s context.xml, or the server’s
> environment, or some other location.****
>
> ** **
>
> I thought I might be able to use the app’s ServletContext, but I can’t
> find my various settings inside that – if I’m even looking the right way.
> (I can get environment-agnostic settings from web.xml already.)****
>
> ** **
>
> Is there a preferred method of getting this type of information?****
>
> ** **
>
> Thanks!****
>
> ** **
>
> --------------------------****
>
> John Wismar****
>
> Alldata Technology****
>
> 916-478-3296****
>
> ** **
>

------------------------------------------------------
http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=2918700

Reply via email to