You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by ptitcon51 <pt...@hotmail.com> on 2009/05/19 12:38:43 UTC

T5 Read parameters form context.xml

Hi all!

T5 reads xml file to configure himself. 
But I don't know if a sexy solution exists to do it myself.
I want to externalize parameters (principally Strings) in my context.xml.
Like this :

<parameter name = "myParam" value="myValue">

I could read my xml file with Properties class like this: 

properties.load("context.xml")
properties.getProperty("MyProp")

But is there a magic T5 solution? With annotations for example... Like it's
possible with properties file.

Thanks all

ptitcon51




-- 
View this message in context: http://www.nabble.com/T5-Read-parameters-form-context.xml-tp23613669p23613669.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: T5 Read parameters form context.xml

Posted by ptitcon51 <pt...@hotmail.com>.
Thanx all for your responses.

Finally, I use  java.utils.Properties class. A regular solution like Borut's
apache solution.
It's for a simple LDAP config, so I don't use DOM for the moment. Maybe
later...

It's a shame that T5 haven't a great solution like 
@config(value="myProp")

Thx all!

ptitcon51

 


Thiago H. de Paula Figueiredo wrote:
> 
> On Tue, May 19, 2009 at 7:38 AM, ptitcon51 <pt...@hotmail.com> wrote:
> 
>> Hi all!
> 
> Hi!
> 
>> T5 reads xml file to configure himself.
> 
> It doesn't read XML files for configuration, just for page and
> component templates. web.xml is read by the servlet container (Jetty,
> Tomcat, etc), not by Tapestry.
> 
>> But I don't know if a sexy solution exists to do it myself.
>> I want to externalize parameters (principally Strings) in my context.xml.
>> Like this :
>>
>> <parameter name = "myParam" value="myValue">
>>
>> I could read my xml file with Properties class like this:
>>
>> properties.load("context.xml")
>> properties.getProperty("MyProp")
>>
>> But is there a magic T5 solution? With annotations for example... Like
>> it's
>> possible with properties file.
> 
> If I understand what you're saying, the solution is outside Tapestry,
> being using some XML package instead. I recommend JDOM.
> 
> -- 
> Thiago
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/T5-Read-parameters-from-context.xml-tp23613669p23619515.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: T5 Read parameters form context.xml

Posted by "Thiago H. de Paula Figueiredo" <th...@gmail.com>.
On Tue, May 19, 2009 at 7:38 AM, ptitcon51 <pt...@hotmail.com> wrote:

> Hi all!

Hi!

> T5 reads xml file to configure himself.

It doesn't read XML files for configuration, just for page and
component templates. web.xml is read by the servlet container (Jetty,
Tomcat, etc), not by Tapestry.

> But I don't know if a sexy solution exists to do it myself.
> I want to externalize parameters (principally Strings) in my context.xml.
> Like this :
>
> <parameter name = "myParam" value="myValue">
>
> I could read my xml file with Properties class like this:
>
> properties.load("context.xml")
> properties.getProperty("MyProp")
>
> But is there a magic T5 solution? With annotations for example... Like it's
> possible with properties file.

If I understand what you're saying, the solution is outside Tapestry,
being using some XML package instead. I recommend JDOM.

-- 
Thiago

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


Re: T5 Read parameters form context.xml

Posted by Borut BolĨina <bo...@gmail.com>.
Have a look at

http://www.chenillekit.org/chenillekit-core/configuration.html

which uses

http://commons.apache.org/configuration/

-Borut

2009/5/19 ptitcon51 <pt...@hotmail.com>

>
> Hi all!
>
> T5 reads xml file to configure himself.
> But I don't know if a sexy solution exists to do it myself.
> I want to externalize parameters (principally Strings) in my context.xml.
> Like this :
>
> <parameter name = "myParam" value="myValue">
>
> I could read my xml file with Properties class like this:
>
> properties.load("context.xml")
> properties.getProperty("MyProp")
>
> But is there a magic T5 solution? With annotations for example... Like it's
> possible with properties file.
>
> Thanks all
>
> ptitcon51
>
>
>
>
> --
> View this message in context:
> http://www.nabble.com/T5-Read-parameters-form-context.xml-tp23613669p23613669.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
>
>