admin login control page


admin login control page

how to encrypted password by using jsp... adminPage.jsp?

View Answers

March 4, 2008 at 3:39 PM

JSP Example code for encrypted password

JSP Encrypted Password Example Code


<title>Admin login Page</title>
<script language="JavaScript">
function isProper(string) {

if (!string) return false;
var iChars = "*|,\":<>[]{}`\';()@&$#%";

for (var i = 0; i < string.length; i++) {
if (iChars.indexOf(string.charAt(i)) != -1)
return false;
return true;

function validateForm(theForm){
//Please enter accountholder
alert("Enter the User Name.");
return false;

if (isProper(theForm.userid.value) == false) {
alert("Please enter a valid User Name.");
return false;

if(theForm.userid.value.length > 20) {
alert("Maximum 20 characters allowed for 'First Name'.")
theForm.userid.focus() ;
return false;

//Please enter accountholder
alert("Enter the password.");
return false;

if (isProper(theForm.password.value) == false) {
alert("Please enter a valid password.");
return false;

if(theForm.password.value.length > 20) {
alert("Maximum 20 characters allowed for 'Password'.")
theForm.password.focus() ;
return false;

return true;
<H1>Admin login Page</H1>
<form method="POST" action="adminPageAction.jsp" onsubmit="return validateForm(this);">

<table border="1" ALIGN="LEFT" cellspacing="0" cellpadding="0" width="50">
<td width="25%"><b>User-Id:</b></td>
<td width="25%">
<input type="text" name="userid" size="20">
<td width="25%"><b>Password:</b></td>
<td width="25%">
<input type="password" name="password" size="20">
<input type="submit" name="submit" value="Submit">


<%@ page language="java" import="java.sql.*,,,sun.misc.BASE64Encoder,sun.misc.CharacterEncoder," %>

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

MessageDigest d = MessageDigest.getInstance("SHA");
byte raw[] = d.digest();
String hash = (new BASE64Encoder()).encode(raw);

catch (SQLException s){
System.out.println("SQL statement is not executed!");
catch (Exception e){



Related Tutorials/Questions & Answers:
admin login control page - JSP-Servlet
admin login control page  how to encrypted password by using jsp... Password Example CodeadminPage.jsp<html> <title>Admin login...>Admin login Page</H1> <form method="POST" action
Admin Page
Admin Page  Hi All, I have to develop Java Web Application using Struts. Can someone please tell me how to code for administration login .i.e when admin login he should have full access whereas others login they should have
Admin and User Login JSP - JSP-Servlet
Admin and User Login JSP  Respected Sir, I am R.Ragavendran.. i need a JSP based program immediately.. In the home page, there must be a login page with username and password fields.. When the username and password is "admin
login page
login page  code for login page
Login page
Login page  how to create Login page in java
Login Page
Login Page  Can anyone tell me the steps to create a login page in myeclipse 7.0 and validating it with login database in db2 9.7 ??? Please tell me
login page
login page  pls say how to create a login page in jsp and mysql using netbaens   Hi Friend, Please visit the following links:
login page
login page  How to login as different user in php
LOGIN PAGE  A java program with "login" as title,menus added, and a text field asking for firstname, lastname, and displaying current date and time
login page
login page  hi i'm trying to create login page using jsp. i get... the program. Following are my programs... 1.index.jsp <%@page contentType="text/html" pageEncoding="UTF-8"%> JSP Page
coding for login page
coding for login page  coding for login page
login page in php
login page in php  How to create a login page in php
html login page with ajax
html login page with ajax  hi all... i want to create a login page...=="yes"){ alert("Welcome User"); }else{ alert("Invalid Login! Please try again!"); } } function call_login(){ var username = window.document.f1.username.value
login  how to login admin and user with the same fields(name & password) in single login page while the table for admin and user is seprate in database(mysql) please provide me solution
login page code in
login page code in  i need front end and backend code for login page in vb using sql server....having code for submit button
jsp login page
jsp login page  hi tell me how to create a login page using jsp and servlet and not using bean... please tell how to create a database in sql server... please tell with code
SSL for login page
SSL for login page  I am trying to apply ssl cert to login page only. Does anyone know how to do this on a tomcat web server
login page error
login page error  How to configure in to config.xml .iam takin to one login form in that form action="/login" .when iam deployee the project... this request." please suggest me.   if your login page is prepared
JSP LOGIN Page  sir....i have two user types usercategory and user and both user have userid and password in two different table and now i am making login page for which i have to retrieve usertype,userid and password from two
login page with image
login page with image  I am writing program for login page.It consists of a image and the login details... how to write a java program using frames that have the default positions in any of the systems.. thanks   i had
Spring Login Page Error
Spring Login Page Error  Dear Sir/Madam, I used the spring login page code. The index page is working fine. When i try to entry login and password , i am getting the below error: Please help me out in this. Let me know if i
login page - Java Beginners
login page  I have one login page in jsp that is login.jsp. Now i have validate user from database by another page validate.jsp. but if the user feeded wrong information then i want to print error massege on the first page
jsp login page
jsp login page  Hi All, can any one tell me how to create Login page using JSP and Beans. A simple log in page. Please reply ASAP. Thanx, am2085   Hello Friend, Please visit the following link: JSP Login Using
Login page validation on ipad
Login page validation on ipad  I am using userId & password labels and their corresponding textfield. Now I want to validate the details by single sign in button and want to switch on to next page. Used two labels again
Admin Module
Admin Module The admin have the privilege  to add the question, delete... the question paper by question Id and by title. The Admin does the following task in the application Login to the application Add The Question Search
HTML login page code
HTML login page code  Hi all, I am writing my first HTML JavaScrip... the complete HTML JavaScript code for User Login Page. Thanks in Advance!   ...;td colspan=2><font size=3><center><b>HTML Login Page
login page validation
login page validation  hi could you please send me code for login validations Email validation and password email should be in correct format and valid password in java   import java.awt.*; import javax.swing.
JSP Login Page Question
JSP Login Page Question  hey..i have a login page where different users first registered and then after they can login. my question is how a user can see only his data after login where different users data are stored
login page with mysql using jsp
login page with mysql using jsp  pls i need a sample of login page to check username and password in mysql database. thanks
login page php mysql example
login page php mysql example  How to create a login page for user in PHP Mysql? Please provide me a complete tutorial. Thanks in Advance
login for different user in the same page
login for different user in the same page  how can i do the login for different user in the same page throug jsp