You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by Nelson Segura <ns...@gmail.com> on 2012/04/20 22:25:47 UTC

urlFor in wicket 1.5

Using Wicket 1.5.4

Have the following mountedPage()

mountPage("/fts/search", FTSResultsPage.class);


In a panel inside that page I have

String pageUrl = urlFor(FTSResultsPage.class,null).toString();

I expect this to be (as in wicket 1.4)

"/fts/search"

But instead it is rendered as

"search"

Is there any explanation for this?

-Nelson Segura

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


Re: urlFor in wicket 1.5

Posted by Nelson Segura <ns...@gmail.com>.
Ah, got it.
In my case, it is a return link passed to a non wicket page that sits
in a different path (but same app context, root in my case). So the
browser cannot solve it directly. I.e. it seems that can be safely
emitted in the same page for which is obtained (or other pages in the
same path)

-Nelson

On Fri, Apr 20, 2012 at 1:49 PM, Igor Vaynberg <ig...@gmail.com> wrote:
> it can be stored in the browser. but you first need to let the browser
> resolve it.
>
> when you are on /fts/foo and you have <a href="search">search</a> you
> can right click search in the browser and add  it as a bookmark. the
> browser will correctly resolve it against the current url and store
> /fts/search.
>
> -igor
>
>
> On Fri, Apr 20, 2012 at 1:48 PM, Nelson Segura <ns...@gmail.com> wrote:
>> :)
>>
>> Maybe in one sense, but not as the API/javadoc for Wicket 1.5 written
>> for urlFor()
>>
>> "Returns a bookmarkable URL that references a given page class using a
>> given set of page parameters. Since the URL which is returned contains
>> all information necessary to instantiate  and render the page, it can
>> be stored in a user's browser as a stable bookmark."
>>
>> As returned by urlFor() the URL cannot be stored in the user's browser
>> as a bookmark.
>>
>> It might be a semantic issue, but if the user has been using that to
>> store URLs, it cannot do it anymore.
>>
>> -Nelson
>>
>>
>> On Fri, Apr 20, 2012 at 1:42 PM, Igor Vaynberg <ig...@gmail.com> wrote:
>>> bookmarkable just means the url contains no session-state. it doesnt
>>> mean that it is absolute.
>>>
>>> -igor
>>>
>>> On Fri, Apr 20, 2012 at 1:31 PM, Nelson Segura <ns...@gmail.com> wrote:
>>>> Except that is not fully bookmarkable as per the API, is it?
>>>> How can I produce a fully bookmarkable URL that can be printed?
>>>>
>>>> I tried to follow this:
>>>>
>>>> RequestCycle.get().getUrlRenderer().renderFullUrl(
>>>>   Url.parse(urlFor(MyPage.class,null).toString()));
>>>>
>>>> from here
>>>> https://cwiki.apache.org/WICKET/getting-a-url-for-display.html
>>>>
>>>> but the URL is still is printed as
>>>>
>>>> http://localhost/search instead of http://localhos/fts/search
>>>>
>>>> -Nelson
>>>>
>>>>
>>>> On Fri, Apr 20, 2012 at 1:27 PM, Igor Vaynberg <ig...@gmail.com> wrote:
>>>>> if you are currently on a /fts/<foo> url, then "search" is correct
>>>>> because relative to /fts/<foo> it will produce /fts/search.
>>>>>
>>>>> -igor
>>>>>
>>>>>
>>>>> On Fri, Apr 20, 2012 at 1:25 PM, Nelson Segura <ns...@gmail.com> wrote:
>>>>>> Using Wicket 1.5.4
>>>>>>
>>>>>> Have the following mountedPage()
>>>>>>
>>>>>> mountPage("/fts/search", FTSResultsPage.class);
>>>>>>
>>>>>>
>>>>>> In a panel inside that page I have
>>>>>>
>>>>>> String pageUrl = urlFor(FTSResultsPage.class,null).toString();
>>>>>>
>>>>>> I expect this to be (as in wicket 1.4)
>>>>>>
>>>>>> "/fts/search"
>>>>>>
>>>>>> But instead it is rendered as
>>>>>>
>>>>>> "search"
>>>>>>
>>>>>> Is there any explanation for this?
>>>>>>
>>>>>> -Nelson Segura
>>>>>>
>>>>>> ---------------------------------------------------------------------
>>>>>> 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
>>>>
>>>
>>> ---------------------------------------------------------------------
>>> 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
>

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


Re: urlFor in wicket 1.5

Posted by Igor Vaynberg <ig...@gmail.com>.
it can be stored in the browser. but you first need to let the browser
resolve it.

when you are on /fts/foo and you have <a href="search">search</a> you
can right click search in the browser and add  it as a bookmark. the
browser will correctly resolve it against the current url and store
/fts/search.

-igor


On Fri, Apr 20, 2012 at 1:48 PM, Nelson Segura <ns...@gmail.com> wrote:
> :)
>
> Maybe in one sense, but not as the API/javadoc for Wicket 1.5 written
> for urlFor()
>
> "Returns a bookmarkable URL that references a given page class using a
> given set of page parameters. Since the URL which is returned contains
> all information necessary to instantiate  and render the page, it can
> be stored in a user's browser as a stable bookmark."
>
> As returned by urlFor() the URL cannot be stored in the user's browser
> as a bookmark.
>
> It might be a semantic issue, but if the user has been using that to
> store URLs, it cannot do it anymore.
>
> -Nelson
>
>
> On Fri, Apr 20, 2012 at 1:42 PM, Igor Vaynberg <ig...@gmail.com> wrote:
>> bookmarkable just means the url contains no session-state. it doesnt
>> mean that it is absolute.
>>
>> -igor
>>
>> On Fri, Apr 20, 2012 at 1:31 PM, Nelson Segura <ns...@gmail.com> wrote:
>>> Except that is not fully bookmarkable as per the API, is it?
>>> How can I produce a fully bookmarkable URL that can be printed?
>>>
>>> I tried to follow this:
>>>
>>> RequestCycle.get().getUrlRenderer().renderFullUrl(
>>>   Url.parse(urlFor(MyPage.class,null).toString()));
>>>
>>> from here
>>> https://cwiki.apache.org/WICKET/getting-a-url-for-display.html
>>>
>>> but the URL is still is printed as
>>>
>>> http://localhost/search instead of http://localhos/fts/search
>>>
>>> -Nelson
>>>
>>>
>>> On Fri, Apr 20, 2012 at 1:27 PM, Igor Vaynberg <ig...@gmail.com> wrote:
>>>> if you are currently on a /fts/<foo> url, then "search" is correct
>>>> because relative to /fts/<foo> it will produce /fts/search.
>>>>
>>>> -igor
>>>>
>>>>
>>>> On Fri, Apr 20, 2012 at 1:25 PM, Nelson Segura <ns...@gmail.com> wrote:
>>>>> Using Wicket 1.5.4
>>>>>
>>>>> Have the following mountedPage()
>>>>>
>>>>> mountPage("/fts/search", FTSResultsPage.class);
>>>>>
>>>>>
>>>>> In a panel inside that page I have
>>>>>
>>>>> String pageUrl = urlFor(FTSResultsPage.class,null).toString();
>>>>>
>>>>> I expect this to be (as in wicket 1.4)
>>>>>
>>>>> "/fts/search"
>>>>>
>>>>> But instead it is rendered as
>>>>>
>>>>> "search"
>>>>>
>>>>> Is there any explanation for this?
>>>>>
>>>>> -Nelson Segura
>>>>>
>>>>> ---------------------------------------------------------------------
>>>>> 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
>>>
>>
>> ---------------------------------------------------------------------
>> 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: urlFor in wicket 1.5

Posted by Nelson Segura <ns...@gmail.com>.
:)

Maybe in one sense, but not as the API/javadoc for Wicket 1.5 written
for urlFor()

"Returns a bookmarkable URL that references a given page class using a
given set of page parameters. Since the URL which is returned contains
all information necessary to instantiate  and render the page, it can
be stored in a user's browser as a stable bookmark."

As returned by urlFor() the URL cannot be stored in the user's browser
as a bookmark.

It might be a semantic issue, but if the user has been using that to
store URLs, it cannot do it anymore.

-Nelson


On Fri, Apr 20, 2012 at 1:42 PM, Igor Vaynberg <ig...@gmail.com> wrote:
> bookmarkable just means the url contains no session-state. it doesnt
> mean that it is absolute.
>
> -igor
>
> On Fri, Apr 20, 2012 at 1:31 PM, Nelson Segura <ns...@gmail.com> wrote:
>> Except that is not fully bookmarkable as per the API, is it?
>> How can I produce a fully bookmarkable URL that can be printed?
>>
>> I tried to follow this:
>>
>> RequestCycle.get().getUrlRenderer().renderFullUrl(
>>   Url.parse(urlFor(MyPage.class,null).toString()));
>>
>> from here
>> https://cwiki.apache.org/WICKET/getting-a-url-for-display.html
>>
>> but the URL is still is printed as
>>
>> http://localhost/search instead of http://localhos/fts/search
>>
>> -Nelson
>>
>>
>> On Fri, Apr 20, 2012 at 1:27 PM, Igor Vaynberg <ig...@gmail.com> wrote:
>>> if you are currently on a /fts/<foo> url, then "search" is correct
>>> because relative to /fts/<foo> it will produce /fts/search.
>>>
>>> -igor
>>>
>>>
>>> On Fri, Apr 20, 2012 at 1:25 PM, Nelson Segura <ns...@gmail.com> wrote:
>>>> Using Wicket 1.5.4
>>>>
>>>> Have the following mountedPage()
>>>>
>>>> mountPage("/fts/search", FTSResultsPage.class);
>>>>
>>>>
>>>> In a panel inside that page I have
>>>>
>>>> String pageUrl = urlFor(FTSResultsPage.class,null).toString();
>>>>
>>>> I expect this to be (as in wicket 1.4)
>>>>
>>>> "/fts/search"
>>>>
>>>> But instead it is rendered as
>>>>
>>>> "search"
>>>>
>>>> Is there any explanation for this?
>>>>
>>>> -Nelson Segura
>>>>
>>>> ---------------------------------------------------------------------
>>>> 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
>>
>
> ---------------------------------------------------------------------
> 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: urlFor in wicket 1.5

Posted by Igor Vaynberg <ig...@gmail.com>.
bookmarkable just means the url contains no session-state. it doesnt
mean that it is absolute.

-igor

On Fri, Apr 20, 2012 at 1:31 PM, Nelson Segura <ns...@gmail.com> wrote:
> Except that is not fully bookmarkable as per the API, is it?
> How can I produce a fully bookmarkable URL that can be printed?
>
> I tried to follow this:
>
> RequestCycle.get().getUrlRenderer().renderFullUrl(
>   Url.parse(urlFor(MyPage.class,null).toString()));
>
> from here
> https://cwiki.apache.org/WICKET/getting-a-url-for-display.html
>
> but the URL is still is printed as
>
> http://localhost/search instead of http://localhos/fts/search
>
> -Nelson
>
>
> On Fri, Apr 20, 2012 at 1:27 PM, Igor Vaynberg <ig...@gmail.com> wrote:
>> if you are currently on a /fts/<foo> url, then "search" is correct
>> because relative to /fts/<foo> it will produce /fts/search.
>>
>> -igor
>>
>>
>> On Fri, Apr 20, 2012 at 1:25 PM, Nelson Segura <ns...@gmail.com> wrote:
>>> Using Wicket 1.5.4
>>>
>>> Have the following mountedPage()
>>>
>>> mountPage("/fts/search", FTSResultsPage.class);
>>>
>>>
>>> In a panel inside that page I have
>>>
>>> String pageUrl = urlFor(FTSResultsPage.class,null).toString();
>>>
>>> I expect this to be (as in wicket 1.4)
>>>
>>> "/fts/search"
>>>
>>> But instead it is rendered as
>>>
>>> "search"
>>>
>>> Is there any explanation for this?
>>>
>>> -Nelson Segura
>>>
>>> ---------------------------------------------------------------------
>>> 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
>

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


Re: urlFor in wicket 1.5

Posted by Nelson Segura <ns...@gmail.com>.
I think that mapUrlFor() seems to produce the results as urlFor() used
to in Wicket 1.5.5

-nelson

On Fri, Apr 20, 2012 at 1:31 PM, Nelson Segura <ns...@gmail.com> wrote:
> Except that is not fully bookmarkable as per the API, is it?
> How can I produce a fully bookmarkable URL that can be printed?
>
> I tried to follow this:
>
> RequestCycle.get().getUrlRenderer().renderFullUrl(
>   Url.parse(urlFor(MyPage.class,null).toString()));
>
> from here
> https://cwiki.apache.org/WICKET/getting-a-url-for-display.html
>
> but the URL is still is printed as
>
> http://localhost/search instead of http://localhos/fts/search
>
> -Nelson
>
>
> On Fri, Apr 20, 2012 at 1:27 PM, Igor Vaynberg <ig...@gmail.com> wrote:
>> if you are currently on a /fts/<foo> url, then "search" is correct
>> because relative to /fts/<foo> it will produce /fts/search.
>>
>> -igor
>>
>>
>> On Fri, Apr 20, 2012 at 1:25 PM, Nelson Segura <ns...@gmail.com> wrote:
>>> Using Wicket 1.5.4
>>>
>>> Have the following mountedPage()
>>>
>>> mountPage("/fts/search", FTSResultsPage.class);
>>>
>>>
>>> In a panel inside that page I have
>>>
>>> String pageUrl = urlFor(FTSResultsPage.class,null).toString();
>>>
>>> I expect this to be (as in wicket 1.4)
>>>
>>> "/fts/search"
>>>
>>> But instead it is rendered as
>>>
>>> "search"
>>>
>>> Is there any explanation for this?
>>>
>>> -Nelson Segura
>>>
>>> ---------------------------------------------------------------------
>>> 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: urlFor in wicket 1.5

Posted by Nelson Segura <ns...@gmail.com>.
Except that is not fully bookmarkable as per the API, is it?
How can I produce a fully bookmarkable URL that can be printed?

I tried to follow this:

RequestCycle.get().getUrlRenderer().renderFullUrl(
   Url.parse(urlFor(MyPage.class,null).toString()));

from here
https://cwiki.apache.org/WICKET/getting-a-url-for-display.html

but the URL is still is printed as

http://localhost/search instead of http://localhos/fts/search

-Nelson


On Fri, Apr 20, 2012 at 1:27 PM, Igor Vaynberg <ig...@gmail.com> wrote:
> if you are currently on a /fts/<foo> url, then "search" is correct
> because relative to /fts/<foo> it will produce /fts/search.
>
> -igor
>
>
> On Fri, Apr 20, 2012 at 1:25 PM, Nelson Segura <ns...@gmail.com> wrote:
>> Using Wicket 1.5.4
>>
>> Have the following mountedPage()
>>
>> mountPage("/fts/search", FTSResultsPage.class);
>>
>>
>> In a panel inside that page I have
>>
>> String pageUrl = urlFor(FTSResultsPage.class,null).toString();
>>
>> I expect this to be (as in wicket 1.4)
>>
>> "/fts/search"
>>
>> But instead it is rendered as
>>
>> "search"
>>
>> Is there any explanation for this?
>>
>> -Nelson Segura
>>
>> ---------------------------------------------------------------------
>> 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: urlFor in wicket 1.5

Posted by Igor Vaynberg <ig...@gmail.com>.
if you are currently on a /fts/<foo> url, then "search" is correct
because relative to /fts/<foo> it will produce /fts/search.

-igor


On Fri, Apr 20, 2012 at 1:25 PM, Nelson Segura <ns...@gmail.com> wrote:
> Using Wicket 1.5.4
>
> Have the following mountedPage()
>
> mountPage("/fts/search", FTSResultsPage.class);
>
>
> In a panel inside that page I have
>
> String pageUrl = urlFor(FTSResultsPage.class,null).toString();
>
> I expect this to be (as in wicket 1.4)
>
> "/fts/search"
>
> But instead it is rendered as
>
> "search"
>
> Is there any explanation for this?
>
> -Nelson Segura
>
> ---------------------------------------------------------------------
> 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