The JSP page to add the auth certification directly responsible for the content (the inside of the body to the new JSP) inside, join after prompt server error, is there any player to know why, thank you,
Start found no problem, then the server to do some changes, they became so, specific changes is:
The code is as follows:
<% @ page import="Java. SQL. *, javax.mail. SQL. *, javax.mail. Naming. *, com. Maxcard. Util. *" % & gt;
<body>
<%
If (request. GetHeader (" Authorization ")==null) {
The response. The setStatus (401);
Response. SetHeader (" WWW - authenticate ", "Basic realm=/" www.maxcard.com/"");
} else {
//input information
String encoded=(request. GetHeader (" Authorization "));
//Base64 is used as the encoded into
String up=StringUtil. DecodeBase64 (encoded);
String user="";
String password="";
If (the up!=null) {
//remove the user name and password
User=up. The substring (0, the up indexOf (" : "));
Password=up. The substring (up. IndexOf (" : ") + 1);
}
If (user. Equals (" David ") & amp; & Password. Equals (" maxcard ")) {
Out. Print (" certification success ");
} else {
Out. Print (" authentication failed ");
}
}
%>