2010/8/24 Major Péter <majorpe...@sch.bme.hu>:
>> I don't think there is simple way to do that (unless you tweak the mapper).
>> Why would you want to do that though? All bookmarkable URLs are
>> generated without the page Id,
>> The redirect is temporary (so google indexes the original URL). URL is
>> still bookmarkable so users can copy and paste it, page Id is pretty
>> much harmless.
>
> I would like to have clean URLs, and page Id on every single URL isn't
> that pretty.
We need to store page id somewhere. The scenario when user loses all
state by refreshing page (in Wicket 1.4) is far from being ideal.
>
>>>> I don't think you can mount same page twice.
>>>
>>> Okay, how can I create aliases for a page then? And how could I create a
>>> nice url for parameterless and 'parameterful' pages? like /show shows a
>>> user own profile, and /show/id/{id} shows another users profile?
>> You can't mount the page twice, because in that case wicket will not
>> know which mapping to use for the page when generating the URL.
>> If you need page to be accessible on both
>> /show
>> and
>> /show/id/4
>>
>> then you need to mount it on /show and treat /id/3 as indexed parameters.
>
> will do, but what about aliases? Let's say I want to support legacy
> uri's, what should I do then?

Make your own mapper for legacy URL that just redirects to the new one.

>
>> Http refereres? Where did that come from?
>>
>> As I said, every time you call getPageParameters() it contains the
>> *current* URL parameters. It might be different from the
>> PageParameters that you got in page constructor, because that was
>> during page construction only.
>>
>> so if you have an entity to show, best way is to use LDM
>> i.e.
>> new LoadableDetachableModel() {
>>     public Object load() {
>>        return userdao.load(getPageParameters().getNamedParameter("user-id"));
>>     }
>> }
>>
>> This will result of the correct entity loaded even if you change page
>> parameters (while leaving the original page id).
>
> oh yeah, I don't use LDM's (I know I should), instead I'm using simple
> propertymodels and compoundpropertymodels. This is a method of yours to
> make people use LDM everywhere?
It's your choice. We don't make you use LDM.
>
> Also the main question was unanswered:
> are you using the browser bar URL for anything after page rendering?
I have answered the question. I told you that after page rendering the
parameters from browser bar are available in getPageParameters().
Wicket doesn't do anything with those parameters as they are specific
to your application. You can query them any time you want.

-Matej
>
> p.s: the quickstart is here: http://aldaris.sch.bme.hu/myproject.tar.gz
>
> Thanks,
> Peter
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>
>

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

Reply via email to