You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by Dirk Forchel <di...@exedio.com> on 2012/09/14 13:46:11 UTC

Using and creating URLs to Bookmarkable Pages without Wicket Application

What is the prefered way in Wicket 1.5 to create page links to access a
wicket page, e.g. using this link in an email. In my case, we need a link to
a "subscription page" in a Wicket application. When a new user subscribes a
confirmation email containing the link to this wicket page has to be sent.
I know the usual way how to generate URLs with a wicket application (see 
https://cwiki.apache.org/WICKET/getting-a-url-for-display.html
https://cwiki.apache.org/WICKET/getting-a-url-for-display.html ). But I want
to create links like this
"http://wicket.website.com/ConfirmationPage.html?user=foo&token=1234"
outside a Wicket application and from another WebServlet.

My intentation was to use an interface like IEmailUrlProvider with methods
returning the required URL strings.



And let Wicket do the generation part like:


Is this the prefered way to do this with Wicket? Or do I miss something? Any
other hints?



--
View this message in context: http://apache-wicket.1842946.n4.nabble.com/Using-and-creating-URLs-to-Bookmarkable-Pages-without-Wicket-Application-tp4652002.html
Sent from the Users forum 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: Using and creating URLs to Bookmarkable Pages without Wicket Application

Posted by Dirk Forchel <di...@exedio.com>.
Thank you for the hint. I just thought about using the WicketTester to "mock"
the behavior (RequestCycle) of getting the url for a mounted page.



--
View this message in context: http://apache-wicket.1842946.n4.nabble.com/Using-and-creating-URLs-to-Bookmarkable-Pages-without-Wicket-Application-tp4652002p4652033.html
Sent from the Users forum 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: Using and creating URLs to Bookmarkable Pages without Wicket Application

Posted by Sven Meier <sv...@meiers.net>.
Hi Dirk,

 >IEmailUrlProviderI

have used a similar approach in a project.

You just have to make sure Wicket's ThreadContext is properly set before 
you access Wicket functionality.

Take a look at BaseWicketTester's constructor.

Hope this helps
Sven

On 09/17/2012 07:10 AM, Dirk Forchel wrote:
> No more hints about generating bookmarkable page links with Wicket?
>
>
>
> --
> View this message in context: http://apache-wicket.1842946.n4.nabble.com/Using-and-creating-URLs-to-Bookmarkable-Pages-without-Wicket-Application-tp4652002p4652024.html
> Sent from the Users forum 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: Using and creating URLs to Bookmarkable Pages without Wicket Application

Posted by Dirk Forchel <di...@exedio.com>.
No more hints about generating bookmarkable page links with Wicket?



--
View this message in context: http://apache-wicket.1842946.n4.nabble.com/Using-and-creating-URLs-to-Bookmarkable-Pages-without-Wicket-Application-tp4652002p4652024.html
Sent from the Users forum 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: Using and creating URLs to Bookmarkable Pages without Wicket Application

Posted by Dirk Forchel <di...@exedio.com>.
I'm already familiar with the usual way how to mount bookmarkable pages and
how to handle page parameters. That's not the point. I don't wanna create
the URLs manually, because Wicket does already have the knowledge about all
mounted pages. The URLs might be change in the future (different segments or
whatever) that's why I wanna use an interface and an implementation within
the wicket package to generate the URLs for me. At least if I have a
WebRequest I can already use Wicket to generate the URLs for me (e.g.
RequestCycle.get().urlFor(Class, PageParameters)). But what happens if I
don't have a WebRequest and a RequestCycle (like using jUnit to test Wicket
Components and/or Pages). I think I have to use something like a "mocked"
RequestCycle. Or do I miss something?



--
View this message in context: http://apache-wicket.1842946.n4.nabble.com/Using-and-creating-URLs-to-Bookmarkable-Pages-without-Wicket-Application-tp4652002p4652009.html
Sent from the Users forum 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: Using and creating URLs to Bookmarkable Pages without Wicket Application

Posted by Fergal Keating <fe...@directski.com>.
Im not clear if this is what your looking for, but it seems you just need
to set your application to be able to accept the URL format
http://wicket.website.com/ConfirmationPage/?user=foo&token=1234<http://wicket.website.com/ConfirmationPage.html?user=foo&token=1234>
and
then you can generate it maually in your emails.

In your MyApplication#init() you can mount a page to

                   mountPage("/confirmationpage/", ConfirmationPage.class);



Then create your  ConfirmationPage to accept
parameters..............something like

public class  ConfirmationPage{

public  ConfirmationPage (final PageParameters parameters) {

    StringValue token= parameters.get("token");
        StringValue user=   parameters.get("user");
     }

}


On 14 September 2012 12:46, Dirk Forchel <di...@exedio.com> wrote:

> What is the prefered way in Wicket 1.5 to create page links to access a
> wicket page, e.g. using this link in an email. In my case, we need a link
> to
> a "subscription page" in a Wicket application. When a new user subscribes a
> confirmation email containing the link to this wicket page has to be sent.
> I know the usual way how to generate URLs with a wicket application (see
> https://cwiki.apache.org/WICKET/getting-a-url-for-display.html
> https://cwiki.apache.org/WICKET/getting-a-url-for-display.html ). But I
> want
> to create links like this
> "http://wicket.website.com/ConfirmationPage.html?user=foo&token=1234"
> outside a Wicket application and from another WebServlet.
>
> My intentation was to use an interface like IEmailUrlProvider with methods
> returning the required URL strings.
>
>
>
> And let Wicket do the generation part like:
>
>
> Is this the prefered way to do this with Wicket? Or do I miss something?
> Any
> other hints?
>
>
>
> --
> View this message in context:
> http://apache-wicket.1842946.n4.nabble.com/Using-and-creating-URLs-to-Bookmarkable-Pages-without-Wicket-Application-tp4652002.html
> Sent from the Users forum 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
>
>


-- 
Fergal Keating
IT Senior Engineer
-----------------------------------------------
e. fergal.keating@directski.com
p. NA
w. www.directski.com