You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by David Chang <da...@yahoo.com> on 2010/03/07 21:15:13 UTC

Where to put an application's configuration parameters?

Hi, I am new in Wicket. 

I did Spring web applications before and I usually put an app's configuration parameters in the application context file. 

I would like to know the best practice in Wichet for setting parameters such as SMTP server, LDAP server, etc. Where should I put them? I dont feel WebApplication is a good place. Put them in an old java properties file? I want these parameters can be changed without touching source code.

Thanks!


      

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


Re: Where to put an application's configuration parameters?

Posted by David Chang <da...@yahoo.com>.
Jeremy, thanks for chiming. I read your transition from Spring to Wicket long time ago. 
Best, David

--- On Sun, 3/7/10, Jeremy Thomerson <je...@wickettraining.com> wrote:

> From: Jeremy Thomerson <je...@wickettraining.com>
> Subject: Re: Where to put an application's configuration parameters?
> To: users@wicket.apache.org
> Date: Sunday, March 7, 2010, 5:28 PM
> I use Spring IoC and do all of my app
> configuration with Spring still.  I
> just use Wicket for the webapp portion.  There's no
> reason Wicket should
> know about these SMTP / LDAP config values - all of that
> should be service
> layer or below.
> 
> --
> Jeremy Thomerson
> http://www.wickettraining.com
> 
> 
> 
> On Sun, Mar 7, 2010 at 2:15 PM, David Chang <da...@yahoo.com>
> wrote:
> 
> > Hi, I am new in Wicket.
> >
> > I did Spring web applications before and I usually put
> an app's
> > configuration parameters in the application context
> file.
> >
> > I would like to know the best practice in Wichet for
> setting parameters
> > such as SMTP server, LDAP server, etc. Where should I
> put them? I dont feel
> > WebApplication is a good place. Put them in an old
> java properties file? I
> > want these parameters can be changed without touching
> source code.
> >
> > Thanks!
> >
> >
> >
> >
> >
> ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> > For additional commands, e-mail: users-help@wicket.apache.org
> >
> >
> 


      

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


Re: Where to put an application's configuration parameters?

Posted by Jeremy Thomerson <je...@wickettraining.com>.
I use Spring IoC and do all of my app configuration with Spring still.  I
just use Wicket for the webapp portion.  There's no reason Wicket should
know about these SMTP / LDAP config values - all of that should be service
layer or below.

--
Jeremy Thomerson
http://www.wickettraining.com



On Sun, Mar 7, 2010 at 2:15 PM, David Chang <da...@yahoo.com> wrote:

> Hi, I am new in Wicket.
>
> I did Spring web applications before and I usually put an app's
> configuration parameters in the application context file.
>
> I would like to know the best practice in Wichet for setting parameters
> such as SMTP server, LDAP server, etc. Where should I put them? I dont feel
> WebApplication is a good place. Put them in an old java properties file? I
> want these parameters can be changed without touching source code.
>
> Thanks!
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>

Re: Where to put an application's configuration parameters?

Posted by James Carman <ja...@carmanconsulting.com>.
That's an interesting idea.  Ldap support is built into the jdk.  Does that
make unit testing interesting or do you have all that stuff abstracted out?

On Mar 8, 2010 8:48 AM, "T Ames" <ta...@gmail.com> wrote:

As an alternative, I place all my properties in an LDAP server.  In the
Application, I have a class that retrieves the properties.



On Sun, Mar 7, 2010 at 8:33 PM, James Carman <james@carmanconsulting.com
>wrote:


> And if you want live redeployment, you could use jrebel and their spring
> plugin. I think it wi...

Re: Where to put an application's configuration parameters?

Posted by T Ames <ta...@gmail.com>.
As an alternative, I place all my properties in an LDAP server.  In the
Application, I have a class that retrieves the properties.



On Sun, Mar 7, 2010 at 8:33 PM, James Carman <ja...@carmanconsulting.com>wrote:

> And if you want live redeployment, you could use jrebel and their spring
> plugin.  I think it will reload beans based on property file changes
>
> On Mar 7, 2010 7:17 PM, "Riyad Kalla" <rk...@gmail.com> wrote:
>
> James,
>
> Thanks for the link.
>
> -R
>
> On Sun, Mar 7, 2010 at 4:50 PM, James Carman <james@carmanconsulting.com
> >wrote:
>
>
> > If you want to see how I did it with spring config, you can check out my
> > advanced wicket demo a...
>

Re: Where to put an application's configuration parameters?

Posted by James Carman <ja...@carmanconsulting.com>.
And if you want live redeployment, you could use jrebel and their spring
plugin.  I think it will reload beans based on property file changes

On Mar 7, 2010 7:17 PM, "Riyad Kalla" <rk...@gmail.com> wrote:

James,

Thanks for the link.

-R

On Sun, Mar 7, 2010 at 4:50 PM, James Carman <james@carmanconsulting.com
>wrote:


> If you want to see how I did it with spring config, you can check out my
> advanced wicket demo a...

Re: Where to put an application's configuration parameters?

Posted by Riyad Kalla <rk...@gmail.com>.
James,

Thanks for the link.

-R

On Sun, Mar 7, 2010 at 4:50 PM, James Carman <ja...@carmanconsulting.com>wrote:

> If you want to see how I did it with spring config, you can check out my
> advanced wicket demo app at:
>
> http://svn.carmanconsulting.com/public/wicket-advanced/trunk
>
> On Mar 7, 2010 5:41 PM, "David Chang" <da...@yahoo.com> wrote:
>
> James and Riyad,
>
> Thanks for your input. I really appreciate it. Wicket is great, but I still
> feel a little elusive.
>
> Regards.
>
>
>
> --- On Sun, 3/7/10, James Carman <jc...@carmanconsulting.com> wrote:
>
> > From: James Carman <jc...@carmanconsulting.com>
>
> > Subject: Re: Where to put an application's configuration parameters?
> > To: users@wicket.apache.org...
> > Date: Sunday, March 7, 2010, 3:26 PM
>
> > Why not use Spring *with* Wicket?
> >
> > On Sun, Mar 7, 2010 at 3:15 PM, David Chang <david_q_zhang@...
>

Re: Where to put an application's configuration parameters?

Posted by James Carman <ja...@carmanconsulting.com>.
If you want to see how I did it with spring config, you can check out my
advanced wicket demo app at:

http://svn.carmanconsulting.com/public/wicket-advanced/trunk

On Mar 7, 2010 5:41 PM, "David Chang" <da...@yahoo.com> wrote:

James and Riyad,

Thanks for your input. I really appreciate it. Wicket is great, but I still
feel a little elusive.

Regards.



--- On Sun, 3/7/10, James Carman <jc...@carmanconsulting.com> wrote:

> From: James Carman <jc...@carmanconsulting.com>

> Subject: Re: Where to put an application's configuration parameters?
> To: users@wicket.apache.org...
> Date: Sunday, March 7, 2010, 3:26 PM

> Why not use Spring *with* Wicket?
>
> On Sun, Mar 7, 2010 at 3:15 PM, David Chang <david_q_zhang@...

Re: Where to put an application's configuration parameters?

Posted by David Chang <da...@yahoo.com>.
James and Riyad, 

Thanks for your input. I really appreciate it. Wicket is great, but I still feel a little elusive.

Regards.



--- On Sun, 3/7/10, James Carman <jc...@carmanconsulting.com> wrote:

> From: James Carman <jc...@carmanconsulting.com>
> Subject: Re: Where to put an application's configuration parameters?
> To: users@wicket.apache.org
> Date: Sunday, March 7, 2010, 3:26 PM
> Why not use Spring *with* Wicket?
> 
> On Sun, Mar 7, 2010 at 3:15 PM, David Chang <da...@yahoo.com>
> wrote:
> > Hi, I am new in Wicket.
> >
> > I did Spring web applications before and I usually put
> an app's configuration parameters in the application context
> file.
> >
> > I would like to know the best practice in Wichet for
> setting parameters such as SMTP server, LDAP server, etc.
> Where should I put them? I dont feel WebApplication is a
> good place. Put them in an old java properties file? I want
> these parameters can be changed without touching source
> code.
> >
> > Thanks!
> >
> >
> >
> >
> >
> ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> > For additional commands, e-mail: users-help@wicket.apache.org
> >
> >
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
> 
> 


      

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


Re: Where to put an application's configuration parameters?

Posted by James Carman <jc...@carmanconsulting.com>.
Why not use Spring *with* Wicket?

On Sun, Mar 7, 2010 at 3:15 PM, David Chang <da...@yahoo.com> wrote:
> Hi, I am new in Wicket.
>
> I did Spring web applications before and I usually put an app's configuration parameters in the application context file.
>
> I would like to know the best practice in Wichet for setting parameters such as SMTP server, LDAP server, etc. Where should I put them? I dont feel WebApplication is a good place. Put them in an old java properties file? I want these parameters can be changed without touching source code.
>
> Thanks!
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>

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


Re: Where to put an application's configuration parameters?

Posted by Riyad Kalla <rk...@gmail.com>.
David,

Given your requirements, I'd recomment putting them in a properties file
along side your custom WebApplication class for your particular application
and then inside of the WebApp's init method, reading in the properties file
and storing the information in the WebApplication.get/setMetaData methods to
store that free-formed information:
http://wicket.apache.org/docs/1.4/org/apache/wicket/Application.html#getMetaData(org.apache.wicket.MetaDataKey)

<http://wicket.apache.org/docs/1.4/org/apache/wicket/Application.html#getMetaData(org.apache.wicket.MetaDataKey)>You
could be fancy and spin off a thread that checks every 10 mins for changes
to the files and re-sets the metadata info if you want to be able to change
that data while the app is running without a restart. Either way, it's just
a plain properties file.

Best,
Riyad

On Sun, Mar 7, 2010 at 1:15 PM, David Chang <da...@yahoo.com> wrote:

> Hi, I am new in Wicket.
>
> I did Spring web applications before and I usually put an app's
> configuration parameters in the application context file.
>
> I would like to know the best practice in Wichet for setting parameters
> such as SMTP server, LDAP server, etc. Where should I put them? I dont feel
> WebApplication is a good place. Put them in an old java properties file? I
> want these parameters can be changed without touching source code.
>
> Thanks!
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>