Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Java > Java and JDK > J2EE
|
J2EE General J2EE (Java 2 Enterprise Edition) discussions. Questions not specific to EE will be redirected elsewhere.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the J2EE section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old October 19th, 2006, 03:35 AM
Authorized User
 
Join Date: Sep 2006
Posts: 59
Thanks: 0
Thanked 0 Times in 0 Posts
Default LOGOUT BOTTON+SERVLETS

I have one Servlet Program.That program generates one form.
Now I want to create one Logout Botton...when i press that Button
I want to get Login Screen.............

prog--1
----------
out.println("<form action="/logout" method="POST">");
out.println("<input type="submit" value="Logout">");
out.println("</form>");
prog-1
------
LogoutServlet.java

web.xml
-------
/logout

Pls give me solution Immediately

Thanks&Regards
Kotaiah.K

 
Old January 2nd, 2007, 01:44 AM
Registered User
 
Join Date: May 2005
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I feel your question is not clear. From what i understood i feel it's quite simple. What you need is 1 login form(login.htm/login.jsp). After login say in between some processing you have a logout button which submits the form to some url like /Logout. In the servlet which has been mapped to this url just do 2 things. (1) invalidating/ destoying the session, & (2) redirecting the user to login screen using either response.sendRedirect("./login.htm") or RequestDispatcher.forward() methods. I think this can resolve your problem.






Similar Threads
Thread Thread Starter Forum Replies Last Post
Enable Excel Close Botton sarfeilee Excel VBA 1 December 22nd, 2008 10:15 AM
crerate a printpage botton for a webpage Patrick19 VB.NET 1 April 13th, 2005 09:03 AM
logout TIME and logout DATE crmpicco Classic ASP Databases 2 January 20th, 2005 12:01 AM
logout TIME and logout DATE crmpicco Classic ASP Basics 0 January 19th, 2005 07:57 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.