You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by "V. Jenks" <za...@gmail.com> on 2007/09/10 19:24:29 UTC

Re: BookmarkablePage URL

Where is this mounting done?  What about parameter values?

What I've got is really quite simple.  I have a static HTML page on an old
web site that needs to link to a wicket page.  The wicket page pulls up a
list of products based on the category provided in the querystring parameter
in the URL.

?catid=1
?catid=2
etc....

It seems like a simple problem but I can't find a good example...


Matej Knopp-2 wrote:
> 
> it's simple :)
> 
> application.mountBookmarkablePage("/home/page", HomePage.class);
> 
> and the url can look like
> http://server.com/context/home/page/cat/4
> 
> -Matej
> 
> On 8/31/07, V. Jenks <za...@gmail.com> wrote:
>>
>>
>> I guess I'm completely confused.  I'm pretty sure I've done it this way
>> before and it worked fine...but it's been a while.  I've never mounted a
>> URL
>> before, I'm not familiar w/ it.
>>
>> I've been going through the Reference Library on the wiki and I can't
>> find
>> an example of how to do this and what the URL actually looks like...can
>> you
>> maybe point me to some instructions?
>>
>> Thanks!
>>
>>
>> Eelco Hillenius wrote:
>> >
>> > On 8/31/07, V. Jenks <za...@gmail.com> wrote:
>> >>
>> >> I'm sure this has been asked 1000x but I'm unable to find the
>> >> answer...and
>> >> don't have enough time left to keep digging.
>> >>
>> >> I simply want to call a bookmarkable page and pass it a parameter
>> >> value...
>> >>
>> >> I got this far but my guesses have so far been wrong:
>> >>
>> >> ?wicket:bookmarkablePage=:com.myapp.BookmarkedPage&catid=1
>> >>
>> >> I get this error:
>> >>
>> >> "ERROR [RequestCycle] Can't instantiate page using constructor public
>> >> com.myapp.BookmarkedPage(wicket.PageParameters) and argument catid =
>> "1""
>> >
>> > That looks like there is a problem constructing your page, not so much
>> > the format. Could you look further in your stack trace? Does
>> > BookmarkedPage has a public default constructor or one with just a
>> > page parameters argument?
>> >
>> > Btw, if you mount your pages (per package or individually), it is a
>> > bit easier to test.
>> >
>> > Eelco
>> >
>> > ---------------------------------------------------------------------
>> > To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>> > For additional commands, e-mail: users-help@wicket.apache.org
>> >
>> >
>> >
>>
>> --
>> View this message in context:
>> http://www.nabble.com/BookmarkablePage-URL-tf4362196.html#a12434374
>> 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
>>
>>
> 
> 

-- 
View this message in context: http://www.nabble.com/BookmarkablePage-URL-tf4362196.html#a12598227
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: BookmarkablePage URL

Posted by Eelco Hillenius <ee...@gmail.com>.
> Where is this mounting done?  What about parameter values?

You would typically do this in your application class, and parameters
are converted to part of the path or something else depending on how
you configure things. See for a simple example "niceurl" of
wicket-examples.

> What I've got is really quite simple.  I have a static HTML page on an old
> web site that needs to link to a wicket page.  The wicket page pulls up a
> list of products based on the category provided in the querystring parameter
> in the URL.
>
> ?catid=1
> ?catid=2
> etc....

/mysite/mymount/catid/1

Eelco

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


Re: BookmarkablePage URL

Posted by Korbinian Bachl <ko...@whiskyworld.de>.

V. Jenks schrieb:
> Where is this mounting done?  

its done in the init() of your WebApplication class e.g:

     /**
      * @see org.apache.wicket.examples.WicketExampleApplication#init()
      */
     protected void init() {
         mount(new HybridUrlCodingStrategy("/index", Index.class));
    }



>What about parameter values?

if you have a page, then make sure your constructor has a PageParameters 
params there, and you can access then your param catid by doing 
params.getString("catid") (or getInt("catid") bit then you will get an 
error if not int).

some more info is here: http://www.javalobby.org/java/forums/t68753.html

Regards,

Korbinian

> 
> What I've got is really quite simple.  I have a static HTML page on an old
> web site that needs to link to a wicket page.  The wicket page pulls up a
> list of products based on the category provided in the querystring parameter
> in the URL.
> 
> ?catid=1
> ?catid=2
> etc....
> 
> It seems like a simple problem but I can't find a good example...
> 
> 
> Matej Knopp-2 wrote:
>> it's simple :)
>>
>> application.mountBookmarkablePage("/home/page", HomePage.class);
>>
>> and the url can look like
>> http://server.com/context/home/page/cat/4
>>
>> -Matej
>>
>> On 8/31/07, V. Jenks <za...@gmail.com> wrote:
>>>
>>> I guess I'm completely confused.  I'm pretty sure I've done it this way
>>> before and it worked fine...but it's been a while.  I've never mounted a
>>> URL
>>> before, I'm not familiar w/ it.
>>>
>>> I've been going through the Reference Library on the wiki and I can't
>>> find
>>> an example of how to do this and what the URL actually looks like...can
>>> you
>>> maybe point me to some instructions?
>>>
>>> Thanks!
>>>
>>>
>>> Eelco Hillenius wrote:
>>>> On 8/31/07, V. Jenks <za...@gmail.com> wrote:
>>>>> I'm sure this has been asked 1000x but I'm unable to find the
>>>>> answer...and
>>>>> don't have enough time left to keep digging.
>>>>>
>>>>> I simply want to call a bookmarkable page and pass it a parameter
>>>>> value...
>>>>>
>>>>> I got this far but my guesses have so far been wrong:
>>>>>
>>>>> ?wicket:bookmarkablePage=:com.myapp.BookmarkedPage&catid=1
>>>>>
>>>>> I get this error:
>>>>>
>>>>> "ERROR [RequestCycle] Can't instantiate page using constructor public
>>>>> com.myapp.BookmarkedPage(wicket.PageParameters) and argument catid =
>>> "1""
>>>> That looks like there is a problem constructing your page, not so much
>>>> the format. Could you look further in your stack trace? Does
>>>> BookmarkedPage has a public default constructor or one with just a
>>>> page parameters argument?
>>>>
>>>> Btw, if you mount your pages (per package or individually), it is a
>>>> bit easier to test.
>>>>
>>>> Eelco
>>>>
>>>> ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>>>> For additional commands, e-mail: users-help@wicket.apache.org
>>>>
>>>>
>>>>
>>> --
>>> View this message in context:
>>> http://www.nabble.com/BookmarkablePage-URL-tf4362196.html#a12434374
>>> 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


Re: BookmarkablePage URL

Posted by Eelco Hillenius <ee...@gmail.com>.
> Where is this mounting done?  What about parameter values?

You would typically do this in your application class, and parameters
are converted to part of the path or something else depending on how
you configure things. See for a simple example "niceurl" of
wicket-examples.

> What I've got is really quite simple.  I have a static HTML page on an old
> web site that needs to link to a wicket page.  The wicket page pulls up a
> list of products based on the category provided in the querystring parameter
> in the URL.
>
> ?catid=1
> ?catid=2
> etc....

/mysite/mymount/catid/1

Eelco

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


Re: BookmarkablePage URL

Posted by Eelco Hillenius <ee...@gmail.com>.
> Where is this mounting done?  What about parameter values?

You would typically do this in your application class, and parameters
are converted to part of the path or something else depending on how
you configure things. See for a simple example "niceurl" of
wicket-examples.

> What I've got is really quite simple.  I have a static HTML page on an old
> web site that needs to link to a wicket page.  The wicket page pulls up a
> list of products based on the category provided in the querystring parameter
> in the URL.
>
> ?catid=1
> ?catid=2
> etc....

/mysite/mymount/catid/1

Eelco

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