|
Here is the code I wrote to verify that the login username and password are correct:
<% @ page contentType = "text / html"%>
<% @ page pageEncoding = "UTF-8"%>
<html>
<head>
<meta http-equiv = "Content-Type" content = "text / html; charset = UTF-8">
<title> Verify user login information </ title>
</ head>
<body>
<h1> Verify user login information </ h1>
<jsp: useBean id = "Mybean" scope = "session" class = "org.me.hello.NameHandler" />
<jsp: setProperty name = "Mybean" property = "*" />
<%
String uid = null, upwd = null;
uid = request.getParameter ("username"). toString ();
upwd = request.getParameter ("userpwd"). toString ();
out.write (uid);
out.write (upwd);
if (uid == "zhx" .toString ()&&upwd == "1")
{
response.sendRedirect ("LogInSuccess.jsp");
}
else
{
}
%>
</ body>
</ html>
The problem now is that when I enter the correct username, I always enter the LogInSuccess.jsp page, which means that the condition of if is false, but my input is correct, and I use out.write () to put The obtained user name and password are typed out correctly, but why can't it execute the correct result? |
|