You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by Alec Swan <al...@gmail.com> on 2010/08/09 22:57:04 UTC

Loading Wicket resources from a background thread

Hello,

I am using Wicket 1.4.5 and I need to read a property from my application
resource file from a Quartz background thread which is scheduled to execute
periodically. When I use StringResourceModel from the background thread I
get an exception saying "There is no application attached to current
thread", which makes sense. How can I read app property from a background
thread?

Also, I deploy my Wicket app to dev and production server and I would like
to have different app properties without touching the files checked out from
SVN. What's the best way to accomplish this? Can I configure Wicket to load
properties from a specific file, e.g. /etc/MyWicketApp.properties?

Thanks,

Alec

Re: Loading Wicket resources from a background thread

Posted by Alec Swan <al...@gmail.com>.
I ended up loading Wicket application properties files using Spring's
PropertyPlaceholderConfigurer and then autowiring it in the class which is
called by a Quartz thread.

Thank you everybody for your help.

On Tue, Aug 10, 2010 at 2:14 PM, rmattler <Ro...@gmail.com> wrote:

>
> Wow just asked this same question.  I didn't see you post (sorry list).
> Please let me know if you figure it out.
> --
> View this message in context:
> http://apache-wicket.1842946.n4.nabble.com/Loading-Wicket-resources-from-a-background-thread-tp2319046p2320388.html
> Sent from the Wicket - User mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>

Re: Loading Wicket resources from a background thread

Posted by rmattler <Ro...@gmail.com>.
Wow just asked this same question.  I didn't see you post (sorry list). 
Please let me know if you figure it out.
-- 
View this message in context: http://apache-wicket.1842946.n4.nabble.com/Loading-Wicket-resources-from-a-background-thread-tp2319046p2320388.html
Sent from the Wicket - User mailing list archive at Nabble.com.

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


Re: Loading Wicket resources from a background thread

Posted by Alec Swan <al...@gmail.com>.
Hello,

In my app I need to access a certain property (application.url) from Wicket
page as well as Quartz background threads. Is there a way to make
properties/resources loaded by Spring accessible through Wicket
StringResourceModel?

Thanks,

Alec

On Mon, Aug 9, 2010 at 4:46 PM, Alec Swan <al...@gmail.com> wrote:

> James, I am not using maven. Any other ideas?
>
>
> On Mon, Aug 9, 2010 at 4:09 PM, James Carman <ja...@carmanconsulting.com>wrote:
>
>> If you're using Maven, you can do something similar to what I've done
>> in my advanced wicket application.
>>
>> http://svn.carmanconsulting.com/public/wicket-advanced/trunk/
>>
>>
>> On Mon, Aug 9, 2010 at 4:57 PM, Alec Swan <al...@gmail.com> wrote:
>> > Hello,
>> >
>> > I am using Wicket 1.4.5 and I need to read a property from my
>> application
>> > resource file from a Quartz background thread which is scheduled to
>> execute
>> > periodically. When I use StringResourceModel from the background thread
>> I
>> > get an exception saying "There is no application attached to current
>> > thread", which makes sense. How can I read app property from a
>> background
>> > thread?
>> >
>> > Also, I deploy my Wicket app to dev and production server and I would
>> like
>> > to have different app properties without touching the files checked out
>> from
>> > SVN. What's the best way to accomplish this? Can I configure Wicket to
>> load
>> > properties from a specific file, e.g. /etc/MyWicketApp.properties?
>> >
>> > Thanks,
>> >
>> > Alec
>> >
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>> For additional commands, e-mail: users-help@wicket.apache.org
>>
>>
>

Re: Loading Wicket resources from a background thread

Posted by Alec Swan <al...@gmail.com>.
James, I am not using maven. Any other ideas?

On Mon, Aug 9, 2010 at 4:09 PM, James Carman <ja...@carmanconsulting.com>wrote:

> If you're using Maven, you can do something similar to what I've done
> in my advanced wicket application.
>
> http://svn.carmanconsulting.com/public/wicket-advanced/trunk/
>
>
> On Mon, Aug 9, 2010 at 4:57 PM, Alec Swan <al...@gmail.com> wrote:
> > Hello,
> >
> > I am using Wicket 1.4.5 and I need to read a property from my application
> > resource file from a Quartz background thread which is scheduled to
> execute
> > periodically. When I use StringResourceModel from the background thread I
> > get an exception saying "There is no application attached to current
> > thread", which makes sense. How can I read app property from a background
> > thread?
> >
> > Also, I deploy my Wicket app to dev and production server and I would
> like
> > to have different app properties without touching the files checked out
> from
> > SVN. What's the best way to accomplish this? Can I configure Wicket to
> load
> > properties from a specific file, e.g. /etc/MyWicketApp.properties?
> >
> > Thanks,
> >
> > Alec
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>

Re: Loading Wicket resources from a background thread

Posted by James Carman <ja...@carmanconsulting.com>.
If you're using Maven, you can do something similar to what I've done
in my advanced wicket application.

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


On Mon, Aug 9, 2010 at 4:57 PM, Alec Swan <al...@gmail.com> wrote:
> Hello,
>
> I am using Wicket 1.4.5 and I need to read a property from my application
> resource file from a Quartz background thread which is scheduled to execute
> periodically. When I use StringResourceModel from the background thread I
> get an exception saying "There is no application attached to current
> thread", which makes sense. How can I read app property from a background
> thread?
>
> Also, I deploy my Wicket app to dev and production server and I would like
> to have different app properties without touching the files checked out from
> SVN. What's the best way to accomplish this? Can I configure Wicket to load
> properties from a specific file, e.g. /etc/MyWicketApp.properties?
>
> Thanks,
>
> Alec
>

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