InvalidateSessionException for log out?

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

InvalidateSessionException for log out?

Vjeran Marcinko
Hi.

I guess everyone is pointing out to problems that are bugging him, and one
of my complaints is missing support for logging out that I reported long
ago:
http://issues.apache.org/jira/browse/TAPESTRY-237
as a good example of how some simple things are always a bit more complex
than they should be.

For example, we have PageRedirectException and RedirectException for
changing request flow once it is in listener method.
Now we wan to perform log out from listener method, so, how does it sound to
introduce something like
throw new InvalidateSessionException(String toPageName);
for that purpose?

Actually, somehow it doesn't seem right to use exceptions for normal
situations since exceptions should be rasied when something bad happened
(Joshua Bloch), but since we already do...

Thoughts?

-Vjeran



--
No virus found in this outgoing message.
Checked by AVG Anti-Virus.
Version: 7.0.308 / Virus Database: 266.11.8 - Release Date: 10.5.2005


---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

RE: InvalidateSessionException for log out?

Patrick Casey

<snip>
> Actually, somehow it doesn't seem right to use exceptions for normal
> situations since exceptions should be rasied when something bad happened
> (Joshua Bloch), but since we already do...
>
> Thoughts?
>
> -Vjeran

Actually, that's been nagging at me as well since I've had it drilled into
my head over and over again "never use exceptions for flow control". I'd
pretty much gotten over it until this afternoon when I was writing some
tapestry code that went like ...

        ...
        super.saveRecord(writer, cycle);
        Writer.print("Total time to process this request : " + clock);
        ...

Only to discover my log messages never, ever, came out. The culprit? I was
using a redirectexception in super.saveRecord() to support the
post->redirect-> get pattern I've implemented in every web app I've ever
written (talk about repetitive :)).

Ultimately though I never bothered squawking about Tapestry's use of
exceptions for flow control because I figured it was pretty deeply
integrated into the system at this point. In other words, its water under
the bridge so there's no point stressing over it.
       
Likewise, I'm actually not sure if there's a general consensus against using
exceptions for flow control in the community at large. It makes me wince
when I see it, but that doesn't mean it's generally bad practice, just that
it's not *my* practice, and lord knows my practices aren't always the best
:).

        --- Pat



---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: InvalidateSessionException for log out?

Erik Hatcher
In reply to this post by Vjeran Marcinko

On May 16, 2005, at 12:51 AM, Vjeran Marcinko wrote:

> For example, we have PageRedirectException and RedirectException for
> changing request flow once it is in listener method.
> Now we wan to perform log out from listener method, so, how does it  
> sound to
> introduce something like
> throw new InvalidateSessionException(String toPageName);
> for that purpose?
>
> Actually, somehow it doesn't seem right to use exceptions for normal
> situations since exceptions should be rasied when something bad  
> happened
> (Joshua Bloch), but since we already do...
>
> Thoughts?

I'm -1 for adding more flow-control exceptions.  The two already  
possible cause trouble when trying to extend Tapestry as it is.  A  
different approach should be taken for the logout needs.

     Erik


---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: InvalidateSessionException for log out?

Vjeran Marcinko
----- Original Message -----
From: "Erik Hatcher" <[hidden email]>
To: "Tapestry users" <[hidden email]>
Sent: Monday, May 16, 2005 11:37 AM
Subject: Re: InvalidateSessionException for log out?


>
> On May 16, 2005, at 12:51 AM, Vjeran Marcinko wrote:
> > For example, we have PageRedirectException and RedirectException for
> > changing request flow once it is in listener method.
> > Now we wan to perform log out from listener method, so, how does it
> > sound to
> > introduce something like
> > throw new InvalidateSessionException(String toPageName);
> > for that purpose?
> >
> > Actually, somehow it doesn't seem right to use exceptions for normal
> > situations since exceptions should be rasied when something bad
> > happened
> > (Joshua Bloch), but since we already do...
> >
> > Thoughts?
>
> I'm -1 for adding more flow-control exceptions.  The two already
> possible cause trouble when trying to extend Tapestry as it is.  A
> different approach should be taken for the logout needs.

Actually, I'm also for other aproaches, but seems than no one had some
proper idea ...

-Vjeran



--
No virus found in this outgoing message.
Checked by AVG Anti-Virus.
Version: 7.0.308 / Virus Database: 266.11.8 - Release Date: 10.5.2005


---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]