Results 1 to 3 of 3
  1. #1
    jaimin.soni is offline Member
    Join Date
    Jan 2012
    Posts
    2
    Rep Power
    0

    Default unable to do log out process

    hello every one,
    i am trainee in one of the it company.in our academic process we have to do the projects.i am doing project in java jsp/jstl. i have perform the task like login with validation,change admin profile,change admin password.
    now the problem came in to the picture i have to perform the log out task means when admin click on the logout button and the page must have to redirect to login.jsp page,when i click on the back button from the browser i will not able to go back to the admin panel again...
    please any one help me..??
    thanks in advance..

  2. #2
    pratydas is offline Member
    Join Date
    Jan 2012
    Posts
    1
    Rep Power
    0

    Default Re: unable to do log out process

    Hi

    Instead of redirecting to your login page you can just redirect to another jsp named logout.jsp and you can try here <%session.invalidate();%> in your jsp which terminates your session. Follow the link which has a complete tutorial on this particularly

    How do I log out of an application that uses Form authentication? - Web Tutorials - avajava.com

  3. #3
    jaimin.soni is offline Member
    Join Date
    Jan 2012
    Posts
    2
    Rep Power
    0

    Default Re: unable to do log out process

    Hello
    pratydas,

    thanks for quick replay to perform the log out task i have specified the code into the logout.jsp just take a look on it and please suggest....:)

    <%@ page import="java.sql.*" %>
    <jsp:useBean id="Oswift" type="jaimin.soni.Jaimin" scope="session"/>

    <%
    try
    {
    Class.forName("oracle.jdbc.driver.OracleDriver").n ewInstance();
    Connection conn=DriverManager.getConnection("jdbc:oracle:thin :@localhost:1521:XE","system","imstupid");
    String gtu,pass;
    gtu=Oswift.getStatus();
    PreparedStatement pst=conn.prepareStatement("update register set status=? where username=?");
    pst.setString(1,"flase");
    pst.setString(2,gtu);
    pst.executeQuery();
    Oswift.setStatus("false");
    session.invalidate();
    String redirectURL = "/Soni/index.jsp";
    response.sendRedirect(redirectURL);
    }
    catch(Exception e)
    {
    System.out.println(e);
    }
    %>
    Thanks in advance

Similar Threads

  1. process synchronisation:
    By javanewuser in forum Threads and Synchronization
    Replies: 0
    Last Post: 03-10-2011, 11:28 AM
  2. How to run and exit a process
    By cracker in forum New To Java
    Replies: 2
    Last Post: 02-15-2011, 04:11 PM
  3. Cmd process streams
    By helloworld922 in forum Advanced Java
    Replies: 0
    Last Post: 10-20-2010, 09:20 AM
  4. Process name
    By logicbug in forum Threads and Synchronization
    Replies: 1
    Last Post: 03-16-2009, 03:11 PM
  5. i need help in http process
    By sureshjava in forum New To Java
    Replies: 0
    Last Post: 01-29-2008, 05:56 AM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •