My mounted pages work perfectly when I use a BookmarkablePageLink to them,
however I am having difficulty when I try to use setResponsePage() to those
same pages. Here's a snipped that I pulled from a Quickstart I'm using to
figure out where I'm going wrong:

        setStatelessHint(true);

        add(new StatelessLink("statelessPage1") {
            public void onClick() {
                setResponsePage(StatelessPage1.class);
            }
        });

        add(new BookmarkablePageLink("statelessPage1-2",
StatelessPage1.class));


The second link produces a nice clean link URL like "
http://localhost:8080/statelessapp/stateless1";, however the first produces a
much less desirable "
http://localhost:8080/statelessapp/?wicket:bookmarkablePage=:com.mycompany.HomePage&wicket:interface=:0:statelessPage1::ILinkListener:
:".

In this simplified example I could clearly use a BookmarkablePageLink in
both situations, however in my real app the logic to determine where a
particualr link needs to go a is occassional conditional so I end up with
something like:

        add(new StatelessLink("statelessPage1") {
            public void onClick() {
                if(somethingIsTrue){
                    setResponsePage(StatelessPage1.class);
                }else{
                    setResponsePage(StatelessPage2.class);
                }
            }
        });

Can someone put me on the right path to using mounted URLs with
setResponsePage()?

Matt

Reply via email to