You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by Benny Weingarten <be...@myworklight.com> on 2008/08/11 07:43:42 UTC

Absolute URL mounting for wicket links in a facebook application

I am trying to have restful URLs for my facebook application.
These links are DYNAMIC, so I can't put them in the markup. I have to use
some sort of wicket Link component.

I have posted this question as a reply on an old thread, with little
responses... so I'm trying to repost in a new thread.:working:

I have tried to follow instruction from the forum here, but I got to a dead
end. Here is my declaration inside MyApp.java.init():

    QueryStringUrlCodingStrategy page1URLS = new
QueryStringUrlCodingStrategy(
    "page1",
                Page1.class
        );
        mount(page1URLS);

        QueryStringUrlCodingStrategy page2URLS = new
QueryStringUrlCodingStrategy(
        "http://apps.facebook.com/myapp/page2",
                Page2.class
        );
    mount(page1URL2);


my application is run in an IFrame in facebook. when I use a
BookmarkablePageLink to link to page1 and page2, The links render to have
the following values:
page1: http://localhost:8080/some-directory/page1?some_param=29
page2: http://apps.facebook.com/bennyworkbook/page2?some_param=2

clicking page1 link works perfectly. however, If the link is bookmarked or
saved by the user, and accessed later, the application is loaded outside the
facebook realm. I would like the links to all point to facebook, so
bookmarking them would link to my application's page ON FACEBOOK.

page2 link looks perfect, because it links to facebook. However, it doesn't
work. I get a 4040 with the following error:
"The requested resource (/page2) is not available."

any ideas how I can have all the links look like page2 link but work good
(link page1 link)?

thanks,
Benny. 
-- 
View this message in context: http://www.nabble.com/Absolute-URL-mounting-for-wicket-links-in-a-facebook-application-tp18920465p18920465.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: Absolute URL mounting for wicket links in a facebook application

Posted by Igor Vaynberg <ig...@gmail.com>.
class myabsolutelink extends bookmarkablepagelink{
  protected string getURL() {
     return (RequestUtils.toAbsoluteUrl("http://whatever.server.you.want/context/mapping/",
super.getURL());
  }
}

-igor

On Sun, Aug 10, 2008 at 10:43 PM, Benny Weingarten
<be...@myworklight.com> wrote:
>
> I am trying to have restful URLs for my facebook application.
> These links are DYNAMIC, so I can't put them in the markup. I have to use
> some sort of wicket Link component.
>
> I have posted this question as a reply on an old thread, with little
> responses... so I'm trying to repost in a new thread.:working:
>
> I have tried to follow instruction from the forum here, but I got to a dead
> end. Here is my declaration inside MyApp.java.init():
>
>    QueryStringUrlCodingStrategy page1URLS = new
> QueryStringUrlCodingStrategy(
>    "page1",
>                Page1.class
>        );
>        mount(page1URLS);
>
>        QueryStringUrlCodingStrategy page2URLS = new
> QueryStringUrlCodingStrategy(
>        "http://apps.facebook.com/myapp/page2",
>                Page2.class
>        );
>    mount(page1URL2);
>
>
> my application is run in an IFrame in facebook. when I use a
> BookmarkablePageLink to link to page1 and page2, The links render to have
> the following values:
> page1: http://localhost:8080/some-directory/page1?some_param=29
> page2: http://apps.facebook.com/bennyworkbook/page2?some_param=2
>
> clicking page1 link works perfectly. however, If the link is bookmarked or
> saved by the user, and accessed later, the application is loaded outside the
> facebook realm. I would like the links to all point to facebook, so
> bookmarking them would link to my application's page ON FACEBOOK.
>
> page2 link looks perfect, because it links to facebook. However, it doesn't
> work. I get a 4040 with the following error:
> "The requested resource (/page2) is not available."
>
> any ideas how I can have all the links look like page2 link but work good
> (link page1 link)?
>
> thanks,
> Benny.
> --
> View this message in context: http://www.nabble.com/Absolute-URL-mounting-for-wicket-links-in-a-facebook-application-tp18920465p18920465.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
>
>

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