You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Dimitris Zenios <di...@gmail.com> on 2013/10/14 19:25:57 UTC

PageRenderLinkSource inside periodic executor

Hello everyone

I am trying to create some links to a tapestry page inside a periodic
executor runnable.I am using pageRenderLinkSource to create the urls but it
throws an exception when trying to construct the url since Request is
null.I know where the problem is (Request is null since periodic executor
does not have a valid Request object to use and create the url)

My question is did anyone else wanted to create page links inside periodic
executor or in cases where a request is null.If yes how did you fixed this?

I was thinking of setting a fake servlet request and set to globals but i
dont know if this is the preferred way

Any solution?

Best Regards
Dimitris Zenios

Re: PageRenderLinkSource inside periodic executor

Posted by Barry Books <tr...@gmail.com>.
Why fake one when it's just as easy to have a real one. As I've said on the
list before create a webpage and call it from Hudson. If you really what to
use a periodic executor then just use url.getContent() in the executor.




On Mon, Oct 14, 2013 at 12:25 PM, Dimitris Zenios <dimitris.zenios@gmail.com
> wrote:

> Hello everyone
>
> I am trying to create some links to a tapestry page inside a periodic
> executor runnable.I am using pageRenderLinkSource to create the urls but it
> throws an exception when trying to construct the url since Request is
> null.I know where the problem is (Request is null since periodic executor
> does not have a valid Request object to use and create the url)
>
> My question is did anyone else wanted to create page links inside periodic
> executor or in cases where a request is null.If yes how did you fixed this?
>
> I was thinking of setting a fake servlet request and set to globals but i
> dont know if this is the preferred way
>
> Any solution?
>
> Best Regards
> Dimitris Zenios
>

Re: PageRenderLinkSource inside periodic executor

Posted by Bob Harner <bo...@gmail.com>.
Just a word of caution that Dmitry's sample code uses an internal
class (LinkImpl)
subject to change.


On Mon, Oct 14, 2013 at 2:54 PM, Dmitry Gusev <dm...@gmail.com>wrote:

> Here is a code snippet I use in my projects to generate links in "offline":
>
> https://gist.github.com/dmitrygusev/6980210
>
> these properties should be declared in your app symbols (of course with
> your own values):
>
> tapestry.hostname=localhost
>
> tapestry.hostport=8080
>
> tapestry.hostport-secure=8443
>
> tapestry.secure-enabled=true
>
>
>
> On Mon, Oct 14, 2013 at 10:37 PM, Lance Java <lance.java@googlemail.com
> >wrote:
>
> > As Barry has said, this might be easier to do inside a real request fired
> > by Hudson. If you want to go down the 'fake' request route then I'll give
> > my tapestry-offline project a plug
> > :)
> >
> > https://github.com/uklance/tapestry-offline
> >
>
>
>
> --
> Dmitry Gusev
>
> AnjLab Team
> http://anjlab.com
>

Re: PageRenderLinkSource inside periodic executor

Posted by Dmitry Gusev <dm...@gmail.com>.
Here is a code snippet I use in my projects to generate links in "offline":

https://gist.github.com/dmitrygusev/6980210

these properties should be declared in your app symbols (of course with
your own values):

tapestry.hostname=localhost

tapestry.hostport=8080

tapestry.hostport-secure=8443

tapestry.secure-enabled=true



On Mon, Oct 14, 2013 at 10:37 PM, Lance Java <la...@googlemail.com>wrote:

> As Barry has said, this might be easier to do inside a real request fired
> by Hudson. If you want to go down the 'fake' request route then I'll give
> my tapestry-offline project a plug
> :)
>
> https://github.com/uklance/tapestry-offline
>



-- 
Dmitry Gusev

AnjLab Team
http://anjlab.com

Re: PageRenderLinkSource inside periodic executor

Posted by Lance Java <la...@googlemail.com>.
As Barry has said, this might be easier to do inside a real request fired
by Hudson. If you want to go down the 'fake' request route then I'll give
my tapestry-offline project a plug
:)

https://github.com/uklance/tapestry-offline