Share on Google+Share on Google+

volla satya srinivas
logout problem
1 Answer(s)      9 years ago
Posted in : Java Beginners

hi,guys thanks for the solutions for previous query.Now I am end of my project.I have written my Logout code as I am... Logout You have logout. Please try again Login


View Answers

April 14, 2008 at 7:47 PM


<title>login page in jsp</title>
<table border="1" width="30%" cellpadding="0" cellspacing="0">
<td width="100%">
<form method="POST" action="loginAction.jsp">
<h2>Login Page In JSP</h2>
<table border="1" width="100%" cellpadding="0" cellspacing="0">
<td width="50%"><b>Username:</b></td>
<td width="50%"><input type="text" name="username" size="25"></td>
<td width="50%"><b>Password:</b></td>
<td width="50%"><input type="password" name="password" size="25"></td>
<p><input type="submit" value="Submit" name="B1">
<input type="reset" value="Reset" name="B2"></p>



<%@ page language="java" import="java.sql.*,java.util.*,java.text.*" %>


Connection con = null;
String url = "jdbc:mysql://localhost:3306/";;
String db = "register";
String driver = "com.mysql.jdbc.Driver";
java.util.Date date;
String s=null;
con = DriverManager.getConnection(url+db,"root","root");
Statement st = con.createStatement();
String username=request.getParameter("username");
String password=request.getParameter("password");

int val = st.executeUpdate("insert userlogin values('"+username+"','"+password+"')");

session.setAttribute("username", request.getParameter("username"));%>
Welcome to <%= session.getAttribute( "username" ) %>

<% if (session.getAttribute("username").equals("") && session.getAttribute("password").equals("")){%>
<a href="loginPage.jsp"><b>Login </b></a>
<a href="logoutAction.jsp"><b>Logout</b></a>
catch (SQLException ex){
System.out.println("SQL statement is not executed!");
catch (Exception e){


<[email protected] import="java.util.*" %>

You have logout. Please try again
<a href="loginPage.jsp"><b>Login</b></a>

Related Tutorials/Questions & Answers:
logout problem
logout problem  I am stuck in my application --- hope anyone can take me out of this... the problem is -- when i logout , the user goes... he has come from .. please get me out of this problem thanks.   Use
logout problem.. - JSP-Servlet
logout problem..  hi... first of all thanks for ur... but their is some problem with the the logout,i m not able to logout when... for trsferring info between various servlet & jsp.and made a logout servlet.which
logout problem?? - JSP-Servlet
logout problem??  sir, the logout code which u have send is not the proper solution coz,by using this code the browser get closed which shuold not logout properly i think we should empty or clear the browser
logout problem - Java Beginners
logout problem  hi,guys thanks for the solutions for previous query.Now I am end of my project.I have written my Logout code as I am... Logout You have logout. Please try again Login   Hi<html><head><
Logout?  how to logout from a jsp page?   Hi to logout from Jsp should use session.invalidate() method. *khalidkhan
login and logout
login and logout   > > > > hi, > >... button with value logout > > and in the action i had given the home.jsp page. > > > > The problem is, when i am
login-logout  how to do login and logout using session in php
logout - Struts
logout  how to make code in struts if i click the logout button then no body can back refresh the page , after logout nobody will able to check the page Thanks Anil  Hi anil, //... session.removeAttribute
jsp logout code
jsp logout code  hello sir, im doing jsp project, i have... tell me what may be the problem. OR if possible pls send me the proper code for logout in jsp and also how to immplement it. thanking you
logout code in JSP
logout code in JSP  im using session.invalidate() for logout but its not working
php login and logout code
php login and logout code  Hi, Can anyone share there code for creating a user login and logout page in PHP?or any useful tutorial that can help to create a login and logout application in PHP.. Thanks in Advance
coding for logout - Development process
coding for logout  hi.. coding for logout using the session in jsp
php session for login and logout
php session for login and logout  Session management code to create a login and logout session in PHP. Thanks
logout - JSP-Servlet
logout  i want to know that (using only servlet technology not jsp) i create login page(html) ,registration.html, home page(servlet) and other pages. when i click the logout(hyperlink) then session is logout frequently
Logout Servlet - JSP-Servlet
Logout Servlet  Hello. I am trying to write servlet that will log user out when the user clicks the log out button or link. Please help
Logout - JSP-Servlet
Logout   HOW TO REMOVE SESSION ID.. IF SISSION LOGOUT . WHEN I PRESS REFRESH BROWSER DEFAULT SESSION ID WILL BE CREATED.FIND THE SOLUTION ABOUT... please click on the given url you will find good example about login/logout
after logout the page is going back - Java Beginners
give details "How to logout the page" to solve the problem. Thanks...after logout the page is going back  Dear friends can any one help me urgently, how to restrict our jsp pages from going back after logout. i 've did
session management for login logout in php
session management for login logout in php  how to manage session for login and logout in php
login/logout operation
login/logout operation  how to do log in/out operations in jsp plz kindly send the steps leing behind this operation  
jsp-logout - JSP-Servlet
jsp-logout  hai friends please provide me a powerful login & logout programs for my web application regarding my project. thanks in advance  Hi Friend, Please visit the following links: http
login/logout operation
login/logout operation  how to do log in/out operations in jsp plz kindly send the steps leing behind this operation  
logout validation - JSP-Servlet
logout validation  sir in my application when i m logging is still going to the back, kindly send me the code which can restrict this. Thanking you.  if you are using the session value, please
Logout - JSP-Servlet
/Logout With Session, the specific url is as below:
Logout - JSP-Servlet
code... I will try to solve your problem. thanks
session syntax for logout - JSP-Servlet
for logout page in login services ?  Hi friend<[email protected] import="java.util.*" %><%session.invalidate();%>You have logout. Please try... and logout features that makes it sure that application is accessible to only authorised
How to disable browser back after logout - JSP-Servlet
page for logout and redirecting in login page. when i am clicking logout session... problem is, when i am clicking browser back button i can see my old visited pages data. I dont want to see my old visited pages after logout or expire the session
JSP Login Logout Example
JSP Login Logout Example In this section we will discuss how to create a simple login and logout example. This section will describe you all the steps for creating a simple login and logout example. To create a simple login logout
jsp code for storing login and logout time to an account
jsp code for storing login and logout time to an account  I need simple jsp code for extracting and storing login and logout time in a database table..plz someone help me...   Please visit the following link: http
After Logout Back Button Should not work again
After Logout Back Button Should not work again  Hi deepak,, I am doing Login Page,.. IN That If Logout Then When I Click Logout Button It Should...")!= null){ //then show the logout button }else{ // show the login button
Spring Security Logout
Spring Security Logout .style1 { margin-left: 40px; } In this section, you will learn about adding logout in Spring Security Application. Before... are not well aware of it. Following changes you should made to implement logout
Logout if its not active for longer period in jsp
Logout if its not active for longer period in jsp  hi all, Please tell me how to log out the application if its not performing any activity... to automatic logout
Java Spring Hibernate Struts Training What does core Java include? java What are some way to learn Java quickly? Is it required to learn Java before learning Java Script? Is it necessary to learn java script before learning PHP? Are HTML5 and Java Script boosts Java career? Is Java object oriented? Fingerprint application with Java Uninstall Oracle Virtual Box JSON to HashMap Free Java online Training I want example of Control Statement in Java ANSI Color Codes with Python Create a Program that Calculates Input What is difference between JDK,JRE and JVM? How to see ubuntu version on server? How to get Page Source in Selenium (WebDriver) using Java? The path to the driver executable must be set by the webdriver.gecko.driver system property parse data from a link in java Java Program Qns using BlueJ How to fix HAX Kernel Module Is Not Installed error? Installing Audacity Looking for code Logic to check track changes & Coments in MSWord, MSWordx, MSExcel, MSExcelx is ON/OFF Installing JDK on Mac SAX Parser exception ERROR 601 (42P00): Syntax error. Encountered Thread java.lang.NoClassDefFoundError: org/apache/commons/fileupload/FileItemFactory How to install Ubuntu 16.04 LTS? HttpServletRequest cannot be resolved to a type in eclipse - Solved Unhandled event loop exception GC overhead limit exceeded Spring Data jpa with apache phoenix Caused by: java.lang.IllegalArgumentException: Not a host:port pair: PBUF o.a.h.h.z.RecoverableZooKeeper - Possibly transient ZooKeeper, quorum= com.thinkaurelius.titan.diskstorage.hbase.HBaseStoreManager class not found com.thinkaurelius.titan.diskstorage.hbase.HBaseStoreManager not found How to download and install Java 8 on Windows? How to uninstall JDK 7? How to install gtk-doc-tools package in Ubuntu? How to install Oracle JDK 8 on Ubuntu? ejabberd_ctl.beam not found - Solved How to convert date to UTC format in Java? How to install autoconf, automake and libtool in Ubuntu 15.10? How to convert current date to mm dd yyyy format in Java? How to convert current date to dd mm yyyy format in Java? How to stop window closing in "internalFrameClosing" event. How to find list of all index in Neo4j? file location SASLError using PLAIN: not-authorized how to convert war file into .exe file using java code


Advertisement null