Mounting and intercept pages

2008-03-20 Thread Jörn Zaefferer
Hi,

I have a bookmarkable page with a single param, something like
domain/item/id/1. Now, to edit the item, the user has to login or
register first. After doing so, either using the login form on the
same page or using the register form on a different page, the user
must land on exactly the same page as before (domain/item/id/1). The
register page must be bookmarkable as well (eg. domain/register).

All my attempts of using Links, BookmarkablePageLinks and
redirectToInterceptPage all yield nothing or yet another URL like
/?wicket:interface=:2 either directly or after the
redirect-back-to-original-target.

Any ideas how to achieve that?

Thanks
Jörn

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Mounting and intercept pages

2008-03-20 Thread Martijn Dashorst
throw new RestartResponseAtInterceptPageException(LoginPage.class);

Martijn

On 3/20/08, Jörn Zaefferer [EMAIL PROTECTED] wrote:
 Hi,

  I have a bookmarkable page with a single param, something like
  domain/item/id/1. Now, to edit the item, the user has to login or
  register first. After doing so, either using the login form on the
  same page or using the register form on a different page, the user
  must land on exactly the same page as before (domain/item/id/1). The
  register page must be bookmarkable as well (eg. domain/register).

  All my attempts of using Links, BookmarkablePageLinks and
  redirectToInterceptPage all yield nothing or yet another URL like
  /?wicket:interface=:2 either directly or after the
  redirect-back-to-original-target.

  Any ideas how to achieve that?

  Thanks
  Jörn

  -
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]




-- 
Buy Wicket in Action: http://manning.com/dashorst
Apache Wicket 1.3.2 is released
Get it now: http://www.apache.org/dyn/closer.cgi/wicket/1.3.2

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Mounting and intercept pages

2008-03-20 Thread Jörn Zaefferer
Thanks Martijn. I gave that a try:

add(new Link(register) {
@Override public void onClick() {
throw new 
RestartResponseAtInterceptPageException(Register.class);
}
@Override
public boolean isVisible() {
return !UserSession.get().isSignedIn();
}
@Override protected CharSequence getURL() {
return urlFor(getPageMap(), Register.class, 
getPageParameters());
}
});

Submitting the register form (page Register) doesn't redirect me back
to the page where was I coming from, instead only displays the
register form again (with a wicket:interface url).

What am I missing?

Jörn

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: Mounting and intercept pages

2008-03-20 Thread Hoover, William
Try the following:

if (!continueToOriginalDestination()) {
setResponsePage(getApplication().getHomePage());
}

-Original Message-
From: Jörn Zaefferer [mailto:[EMAIL PROTECTED]
Sent: Thursday, March 20, 2008 9:13 AM
To: users@wicket.apache.org
Subject: Re: Mounting and intercept pages


Thanks Martijn. I gave that a try:

add(new Link(register) {
@Override public void onClick() {
throw new 
RestartResponseAtInterceptPageException(Register.class);
}
@Override
public boolean isVisible() {
return !UserSession.get().isSignedIn();
}
@Override protected CharSequence getURL() {
return urlFor(getPageMap(), Register.class, 
getPageParameters());
}
});

Submitting the register form (page Register) doesn't redirect me back
to the page where was I coming from, instead only displays the
register form again (with a wicket:interface url).

What am I missing?

Jörn

-
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]



Re: Mounting and intercept pages

2008-03-20 Thread Jörn Zaefferer
When throwing the Restart... exception,
continueToOriginalDestination() yields false.

On Thu, Mar 20, 2008 at 2:17 PM, Hoover, William [EMAIL PROTECTED] wrote:
 Try the following:

  if (!continueToOriginalDestination()) {
 setResponsePage(getApplication().getHomePage());


 }

  -Original Message-
  From: Jörn Zaefferer [mailto:[EMAIL PROTECTED]
  Sent: Thursday, March 20, 2008 9:13 AM
  To: users@wicket.apache.org
  Subject: Re: Mounting and intercept pages


  Thanks Martijn. I gave that a try:

  add(new Link(register) {
 @Override public void onClick() {
 throw new 
 RestartResponseAtInterceptPageException(Register.class);
 }
 @Override
 public boolean isVisible() {
 return !UserSession.get().isSignedIn();
 }
 @Override protected CharSequence getURL() {
 return urlFor(getPageMap(), Register.class, 
 getPageParameters());
 }
  });

  Submitting the register form (page Register) doesn't redirect me back
  to the page where was I coming from, instead only displays the
  register form again (with a wicket:interface url).

  What am I missing?

  Jörn



 -
  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]



Re: Mounting and intercept pages

2008-03-20 Thread Igor Vaynberg
it all depends on what url your security strategy intercepts - that is
the url continuetoorigdest will use. so if your strategy intercepts a
bookmarkable url you should be good, but if it intercepts a link url
like ?wicket:interface that is where you will go back to...

-igor


On Thu, Mar 20, 2008 at 2:55 AM, Jörn Zaefferer
[EMAIL PROTECTED] wrote:
 Hi,

  I have a bookmarkable page with a single param, something like
  domain/item/id/1. Now, to edit the item, the user has to login or
  register first. After doing so, either using the login form on the
  same page or using the register form on a different page, the user
  must land on exactly the same page as before (domain/item/id/1). The
  register page must be bookmarkable as well (eg. domain/register).

  All my attempts of using Links, BookmarkablePageLinks and
  redirectToInterceptPage all yield nothing or yet another URL like
  /?wicket:interface=:2 either directly or after the
  redirect-back-to-original-target.

  Any ideas how to achieve that?

  Thanks
  Jörn

  -
  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]