Nevermind, I thought it was a link listener URL, but maybe it's not.
Here's what I'm seeing. I have my home page (a quickstart app) set up
to do a link to AnotherPage in two different ways:
public HomePage()
{
add(new Link("link1")
{
public void onClick()
{
setResponsePage(new AnotherPage());
setRedirect(true);
}
});
add(new Link("link2")
{
public void onClick()
{
setResponsePage(AnotherPage.class);
setRedirect(true);
}
});
}
<html>
<head>
<title>Wicket Quickstart Archetype Homepage</title>
</head>
<body>
<a href="#" wicket:id="link1">Page Instance Link</a>
<br/>
<a href="#" wicket:id="link2">Class Link</a>
</body>
</html>
I also have HomePage mounted as such (AnotherPage is in the same package):
mount(new PackageRequestTargetUrlCodingStrategy("/home",
PackageName.forClass(HomePage.class)));
So, here's what I get when HomePage renders:
<html>
<head>
<title>Wicket Quickstart Archetype Homepage</title>
</head>
<body>
<a href="../../?wicket:interface=:14:link1::ILinkListener::"
wicket:id="link1">Page Instance Link</a>
<br/>
<a href="../../?wicket:interface=:14:link2::ILinkListener::"
wicket:id="link2">Class Link</a>
</body>
</html>
When I click link1, the browser's URL is:
http://localhost:8080/myproject/?wicket:interface=:15::::
When I click link2, the browser's URL is:
http://localhost:8080/myproject/home/AnotherPage/
So, it looked like a redirect wasn't happening in the first case. Is it?
On Fri, Mar 28, 2008 at 8:16 PM, James Carman
<[EMAIL PROTECTED]> wrote:
> Well, I tried it with doing setResponsePage(new MyOtherPage()) and URL
> still looked like the link listener URL. But, when I did
> setResponsePage(MyOtherPage.class), the URL changed to whatever I
> mounted it to. I assumed that meant that the redirect wasn't
> happening. I could be wrong.
>
>
>
>
> On Fri, Mar 28, 2008 at 7:47 PM, Johan Compagner <[EMAIL PROTECTED]> wrote:
> > what do you mean redirect does't work?
> > 90% of the time if you do setResponsePage(new Page())
> > a redirect is done anyway. (for example if you do that in onSubmit)
> > To go around for example the double post problem if you go back in history
> > or refresh the page.
> >
> > johan
> >
> > On Sat, Mar 29, 2008 at 12:15 AM, James Carman <[EMAIL PROTECTED]>
> >
> >
> > wrote:
> >
> > > Oh, and redirect doesn't work with the Page version (at least in my
> > > tests it didn't).
> > >
> > > On Fri, Mar 28, 2008 at 7:13 PM, James Carman
> > > <[EMAIL PROTECTED]> wrote:
> > > > If you need to initialize the page instance in some way (by passing
> > > > constructor params, for instance), you use the Page version. The
> > > > other version just uses Class.newInstance() to instantiate the page
> > > > object.
> > > >
> > > >
> > > >
> > > > On Fri, Mar 28, 2008 at 6:44 PM, Timm Helbig <
> > > [EMAIL PROTECTED]> wrote:
> > > > > Hi,
> > > > >
> > > > > I have read several times in the mailing list, that it is bad to
> use
> > > > > setRespsonsePage(Page p). What is the backdraw compared to
> > > > > setResponsePage(Class c) ?
> > > > >
> > > > > In my case a Form Submit redirects to another Page, that needs
> some
> > > initial
> > > > > data given through the Constructor, e.g. MyPage(MyInitialData
> data)
> > > {} .
> > > > >
> > > > > Regards,
> > > > > Timm
> > > > >
> > > > >
> > > ---------------------------------------------------------------------
> > > > > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > > > > For additional commands, e-mail: [EMAIL PROTECTED]
> > > > >
> > > > >
> > > >
> > >
> > > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > > For additional commands, e-mail: [EMAIL PROTECTED]
> > >
> > >
> >
>
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]