code show as below:
<% @ page import = "java.sql. *, javax.sql. *, javax.naming. *, com.maxcard.util. *"%>
new document title> hEAD>
<% IF ("Authorization") == null) {response.setstatus (401); response.setheader ("www-authenticate", "Basic realm = /" www.maxcard.com/ " "} else {
// Acquire the input information string eNCoded = ("Authorization")); // Use the Base64 as a conversion string Up = Stringutil.DecodeBase64 (Encode); string user = "; string password ="
IF (Up! = null) {
// Remove the username and password
User = Up.substring (0, Up.indexof (":")); password = up.substring (Up.indexof (":") 1);}
IF (User.Equals ("David" && password.equals ("maxcard")) {OUT.PRINT ("authentication success");} else {Out.print ("authentication failed");}}%> body > html> related toolkit download: http://www.bcxy.com/java/dbutil.htm