Logout Code!!!

S

Subho

Hi ,

CAn anybody tell me how to write a logout code in Struts 2? Also how
to handle the browser back button in Struts 2.

Any help is appreciated.

Regards,
Subhash
 
A

Arne Vajhøj

Subho said:
CAn anybody tell me how to write a logout code in Struts 2? Also how
to handle the browser back button in Struts 2.

If you manage login status in app, then only you knows
how to logout.

If you let the container manage login status, then just use:
session.invalidate();

Arne
 
L

Lew

Subho said:
CAn anybody tell me how ...
to handle the browser back button in Struts 2.

Use a synchronization token.

<http://www.corej2eepatterns.com/Design/PresoDesign.htm>
"Synchronizer (or Déjà vu) Token"

<http://www.mnot.net/blog/2003/09/13/click_submit_only_once>
<http://www.javaworld.com/javaworld/javatips/jw-javatip136.html>
<http://www.eaipatterns.com/IdempotentReceiver.html>
<http://mindprod.com/jgloss/idempotent.html>

An interesting variation on this is to put the token in the session when a
page is first displayed, and remove it from the session when the first
"submit" arrives from that page. If that page returns a token and there is no
token in the session, it's a replay. This enforces idempotence.

Under no circumstances may you override the client-side behavior of the back
button. Client actions are not for the server to control.

Under no circumstances may you override the client-side behavior of the back
button. Client actions are not for the server to control.

What you can do is prevent retrace or resubmission on the client side from
adversely affecting server-side state.

Under no circumstances may you override the client-side behavior of the back
button. Client actions are not for the server to control.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,774
Messages
2,569,596
Members
45,143
Latest member
SterlingLa
Top