You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@wicket.apache.org by "martin.dilger" <ma...@googlemail.com> on 2013/06/28 16:17:54 UTC

RestartResponseAtInterceptPageException#continueToOriginalDestination

Hi,

just wondering, is there any Reason why
RestartResponseAtInterceptPageException#continueToOriginalDestination is
Package-Private and not public?
It is called in Component#continueToOriginalDestination which is itself
non-static.

In my Mind,
RestartResponseAtInterceptPageException#continueToOriginalDestination should
be public to be usable outside of components, which is a perfect legal case.

I would file a Bug, but first would love to hear, if there is a reason I
miss.



--
View this message in context: http://apache-wicket.1842946.n4.nabble.com/RestartResponseAtInterceptPageException-continueToOriginalDestination-tp4659907.html
Sent from the Forum for Wicket Core developers mailing list archive at Nabble.com.

Re: RestartResponseAtInterceptPageException#continueToOriginalDestination

Posted by Igor Vaynberg <ig...@gmail.com>.
go for it

On Fri, Jun 28, 2013 at 11:43 PM, martin.dilger
<ma...@googlemail.com> wrote:
> That sounds like a pretty good thing. Should I file a Ticket?
>
>
>
> --
> View this message in context: http://apache-wicket.1842946.n4.nabble.com/RestartResponseAtInterceptPageException-continueToOriginalDestination-tp4659907p4659920.html
> Sent from the Forum for Wicket Core developers mailing list archive at Nabble.com.

Re: RestartResponseAtInterceptPageException#continueToOriginalDestination

Posted by "martin.dilger" <ma...@googlemail.com>.
That sounds like a pretty good thing. Should I file a Ticket?



--
View this message in context: http://apache-wicket.1842946.n4.nabble.com/RestartResponseAtInterceptPageException-continueToOriginalDestination-tp4659907p4659920.html
Sent from the Forum for Wicket Core developers mailing list archive at Nabble.com.

Re: RestartResponseAtInterceptPageException#continueToOriginalDestination

Posted by Igor Vaynberg <ig...@gmail.com>.
i think the middle ground is to add
RequestCycle#continueToOriginalDestination(). that way its your job to
make sure you actually have a valid wicket scope before attempting to
call that method.

-igor

On Fri, Jun 28, 2013 at 11:49 AM, martin.dilger
<ma...@googlemail.com> wrote:
> Hi Igor,
>
> We dont talk about different layers.
> Even if my class would be named SignInAction, it belongs to the UI-Layer and
> thats the only valid place, thats completely right.
> Could be a Spring Bean for example, that throws some use case specific
> authentication - exceptions (AuthenticationFailed, InvalidCredentials,
> UsernameNotFound... ) that are handled at a central place -
> RequestCycleListener for example.
>
>
>
>
>
> --
> View this message in context: http://apache-wicket.1842946.n4.nabble.com/RestartResponseAtInterceptPageException-continueToOriginalDestination-tp4659907p4659915.html
> Sent from the Forum for Wicket Core developers mailing list archive at Nabble.com.

Re: RestartResponseAtInterceptPageException#continueToOriginalDestination

Posted by "martin.dilger" <ma...@googlemail.com>.
Hi Igor,

We dont talk about different layers.
Even if my class would be named SignInAction, it belongs to the UI-Layer and
thats the only valid place, thats completely right.
Could be a Spring Bean for example, that throws some use case specific
authentication - exceptions (AuthenticationFailed, InvalidCredentials,
UsernameNotFound... ) that are handled at a central place -
RequestCycleListener for example.





--
View this message in context: http://apache-wicket.1842946.n4.nabble.com/RestartResponseAtInterceptPageException-continueToOriginalDestination-tp4659907p4659915.html
Sent from the Forum for Wicket Core developers mailing list archive at Nabble.com.

Re: RestartResponseAtInterceptPageException#continueToOriginalDestination

Posted by Igor Vaynberg <ig...@gmail.com>.
this does not seem cluttered to me:

1 add(new Button("login") {
2  onsubmit() {
3     if (authenticator.login(username, password)) {
4        continueToOriginalDestination();
5        setResponsePage(UserHome.class);
6    } else {
7       error("login failed");
8   }
9 }

do you expect to call setResponsePage(UserHome.class) from your action
as well, in case there is no intercept page?

do you expect to call error() from that action?

it seems to me that lines 4,5, and 7 all belong in your UI-layer and
should not be in a layer below...my two cents.

-igor

On Fri, Jun 28, 2013 at 8:29 AM, martin.dilger
<ma...@googlemail.com> wrote:
> Maybe an addition, dont get me wrong, everything is possible the way it is.
> I´m just asking for convenience to declutter some of my components.
>
>
>
> --
> View this message in context: http://apache-wicket.1842946.n4.nabble.com/RestartResponseAtInterceptPageException-continueToOriginalDestination-tp4659907p4659913.html
> Sent from the Forum for Wicket Core developers mailing list archive at Nabble.com.

Re: RestartResponseAtInterceptPageException#continueToOriginalDestination

Posted by "martin.dilger" <ma...@googlemail.com>.
Maybe an addition, dont get me wrong, everything is possible the way it is.
I´m just asking for convenience to declutter some of my components.



--
View this message in context: http://apache-wicket.1842946.n4.nabble.com/RestartResponseAtInterceptPageException-continueToOriginalDestination-tp4659907p4659913.html
Sent from the Forum for Wicket Core developers mailing list archive at Nabble.com.

Re: RestartResponseAtInterceptPageException#continueToOriginalDestination

Posted by "martin.dilger" <ma...@googlemail.com>.
oh it is backed by wicket (what else?:)) but I dont want to clutter my
components with all this stuff when it is propably reasonable to place it
somewhere else. In my case, the virtual SignInAction would handle
everything, not the component, the component is only the wrapper for ui etc.  



--
View this message in context: http://apache-wicket.1842946.n4.nabble.com/RestartResponseAtInterceptPageException-continueToOriginalDestination-tp4659907p4659912.html
Sent from the Forum for Wicket Core developers mailing list archive at Nabble.com.

Re: RestartResponseAtInterceptPageException#continueToOriginalDestination

Posted by Igor Vaynberg <ig...@gmail.com>.
if your form is not backed by wicket i do not think you should count
on being within a wicket request cycle...

-igor


On Fri, Jun 28, 2013 at 7:43 AM, martin.dilger
<ma...@googlemail.com> wrote:
> Hi Martin,
>
> image the typical SignIn-Functionality.
>
> You have a SignInPanel which only shows the necessary Form Components.
>
> Then you have some sort of Bean like SignInActionXYZ, which has in its
> perform method the typical flow:
>
> if(signInSuccesful()){
>    //well, check if there was some interception
>   RestartResponseAtInterceptPageException.continueToOriginalDestination()
>   //no, ok, do some Other stuff
> }
>
> Of coure you are right, in many cases (but not all) it is valid and good to
> work from Component.
> BUT in some cases it is ok and good, to have this Possibility from other
> Classes.
>
>
>
>
>
> --
> View this message in context: http://apache-wicket.1842946.n4.nabble.com/RestartResponseAtInterceptPageException-continueToOriginalDestination-tp4659907p4659909.html
> Sent from the Forum for Wicket Core developers mailing list archive at Nabble.com.

Re: RestartResponseAtInterceptPageException#continueToOriginalDestination

Posted by "martin.dilger" <ma...@googlemail.com>.
Hi Martin,

image the typical SignIn-Functionality.

You have a SignInPanel which only shows the necessary Form Components.

Then you have some sort of Bean like SignInActionXYZ, which has in its
perform method the typical flow:

if(signInSuccesful()){
   //well, check if there was some interception
  RestartResponseAtInterceptPageException.continueToOriginalDestination()
  //no, ok, do some Other stuff
}

Of coure you are right, in many cases (but not all) it is valid and good to
work from Component.
BUT in some cases it is ok and good, to have this Possibility from other
Classes.





--
View this message in context: http://apache-wicket.1842946.n4.nabble.com/RestartResponseAtInterceptPageException-continueToOriginalDestination-tp4659907p4659909.html
Sent from the Forum for Wicket Core developers mailing list archive at Nabble.com.

Re: RestartResponseAtInterceptPageException#continueToOriginalDestination

Posted by Martin Grigorov <mg...@apache.org>.
On Fri, Jun 28, 2013 at 5:17 PM, martin.dilger <martin.dilger@googlemail.com
> wrote:

> Hi,
>
> just wondering, is there any Reason why
> RestartResponseAtInterceptPageException#continueToOriginalDestination is
> Package-Private and not public?
> It is called in Component#continueToOriginalDestination which is itself
> non-static.
>
> In my Mind,
> RestartResponseAtInterceptPageException#continueToOriginalDestination
> should
> be public to be usable outside of components, which is a perfect legal
> case.
>

So you want to control the flow from a non-component ?
What is the use case ?


>
> I would file a Bug, but first would love to hear, if there is a reason I
> miss.
>
>
>
> --
> View this message in context:
> http://apache-wicket.1842946.n4.nabble.com/RestartResponseAtInterceptPageException-continueToOriginalDestination-tp4659907.html
> Sent from the Forum for Wicket Core developers mailing list archive at
> Nabble.com.
>