You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by bhorvat <ho...@gmail.com> on 2011/12/16 23:11:33 UTC
Accessing symbols from system properties
I am trying to access the symbol properties that are defined when starting
the application using maven like so
<configuration>
<systemProperties>
<systemProperty>
<name>hibernate.configuration</name>
<value>dbt.cfg.xml</value>
</systemProperty>
<systemProperty>
<name>tapestry.production-mode</name>
<value>false}</value>
</systemProperty>
</systemProperties>
</configuration>
If I try to access the property that is standard to tapestry like
tapestry.production-mode using the instructions
http://tapestry.apache.org/symbols.html
http://tapestry.apache.org/symbols.html
like this
@Value("${tapestry.production-mode}") boolean productionMode
it works fine but if try to access the non tapestry property in the same
manner it is not working and it should according to the link
SystemProperties Provider
The first provider allows JVM System Properties to provide symbol values.
This allows the use of the java command's -D option to provide runtime
overrides. This is most often used when testing code, rather than in
production. SystemProperties is always checked first.
How can I access the property from the SystemProperties. Any idea?
Thank you and sorry for all the questions today :)
--
View this message in context: http://tapestry.1045711.n5.nabble.com/Accessing-symbols-from-system-properties-tp5081589p5081589.html
Sent from the Tapestry - User mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org
Re: Accessing symbols from system properties
Posted by bhorvat <ho...@gmail.com>.
Now it is working fine, maybe I have misspelled the property before.
I am using it like this as a parameter of the method (maybe that is the
point), before I have used it as a property of the class
@Value("${hibernate.configuration}") final String configFile
Anyway thanks for help
--
View this message in context: http://tapestry.1045711.n5.nabble.com/Accessing-symbols-from-system-properties-tp5081589p5081871.html
Sent from the Tapestry - User mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org
Re: Accessing symbols from system properties
Posted by Taha Hafeez Siddiqi <ta...@gmail.com>.
I don't think if can differentiate between a "standard" property
Are you sure it is picking up your configuration.
This might help
http://stackoverflow.com/questions/3231797/specify-system-property-to-maven-project
regards
Taha
On Dec 17, 2011, at 3:41 AM, bhorvat wrote:
> I am trying to access the symbol properties that are defined when starting
> the application using maven like so
>
> <configuration>
> <systemProperties>
> <systemProperty>
> <name>hibernate.configuration</name>
> <value>dbt.cfg.xml</value>
> </systemProperty>
> <systemProperty>
> <name>tapestry.production-mode</name>
> <value>false}</value>
> </systemProperty>
> </systemProperties>
> </configuration>
>
> If I try to access the property that is standard to tapestry like
> tapestry.production-mode using the instructions
> http://tapestry.apache.org/symbols.html
> http://tapestry.apache.org/symbols.html
>
> like this
>
> @Value("${tapestry.production-mode}") boolean productionMode
>
> it works fine but if try to access the non tapestry property in the same
> manner it is not working and it should according to the link
>
> SystemProperties Provider
> The first provider allows JVM System Properties to provide symbol values.
> This allows the use of the java command's -D option to provide runtime
> overrides. This is most often used when testing code, rather than in
> production. SystemProperties is always checked first.
>
> How can I access the property from the SystemProperties. Any idea?
>
> Thank you and sorry for all the questions today :)
>
>
> --
> View this message in context: http://tapestry.1045711.n5.nabble.com/Accessing-symbols-from-system-properties-tp5081589p5081589.html
> Sent from the Tapestry - User mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>