关于JSP网页的登录界面 我的验证码只有图 没有验证 大神求指导。。。
下面是我的注册页面的代码 JSP 但是输入验证码的正确与否并没有影响到我的网页的登录 验证图片出来了 = = 大神求指导
谢谢~
<%@ page language="java" import="java.util.*,Mod.*,Dal.*" pageEncoding="utf-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>My JSP 'top.jsp' starting page</title>
<link href="css/master.css" rel="stylesheet" type="text/css" />
<link href="css/main.css" rel="stylesheet" type="text/css" />
<base href="<%=basePath%>">
</head>
<%
String incode = (String)request.getParameter("code");
String rightcode = (String)session.getAttribute("rCode");
if(incode != null && rightcode != null){
if(incode.equals(rightcode)){
out.println("验证码输入正确!");
}else{
out.println("验证码输入不正确,请重新输入!");
}
}
%>
<body>
<div class="lefttop"><b>会员中心</b></div>
<%if(session.getAttribute("client")==null){ %>
<form method="post" name="myform" action="Ref/reg.jsp?param=login" onsubmit="return sub()">
<table cellpadding="0" cellspacing="0" id="logintable">
<tr>
<td class="login_left">账号:</td>
<td class="login_right"><input id="Text1" name="login" type="text" /></td>
</tr>
<tr>
<td class="login_left">密码:</td>
<td class="login_right"><input id="Text2" name="pass" type="password" /></td>
</tr>
<tr>
<td class="login_left">验证码: </td>
<td class="login_right"> <img src="number.jsp"/> <input type="text" name="code"/> </td>
</tr>
<tr>
<td class="login_center" colspan="2"><a href="reg.jsp">免费注册?</a></td>
</tr>
<tr>
<td class="login_center" colspan="2">
<input id="Button1" type="submit" value="登陆" />
</td>
</tr>
</table>
</form>
<%}else{
Client left_c=(Client)session.getAttribute("client");
left_c=new ClientServer().GetByID(left_c.getId());
%>
<table cellpadding="0" cellspacing="0" id="logintable">
<tr>
<td class="login_left">登陆名:</td>
<td class="login_right"><%=left_c.getLogin() %><a href="Ref/reg.jsp?param=exit" style="color:#6AA5C7">【退出】</a></td>
</tr>
<tr>
<td class="login_left">姓名:</td>
<td class="login_right"><%=left_c.getName() %></td>
</tr>
<tr>
<td class="login_left">余额:</td>
<td class="login_right"><%=left_c.getMoney() %>元</td>
</tr>
<tr>
<td class="login_center" colspan="2"><a href="myding.jsp">我的申请</a><a href="chong.jsp" style="color:red">在线充值</a></td>
</tr>
<tr>
<td class="login_center" colspan="2"><a href="addcar.jsp">发布车辆</a><a href="mycar.jsp">我的车辆</a></td>
</tr>
<tr>
<td class="login_center" colspan="2"><a href="edit.jsp">修改资料</a><a href="pwd.jsp">修改密码</a></td>
</tr>
</table>
<%} %>
<div class="lefttop"><b>车型种类</b></div>
<div class="leftul">
<ul>
<%
List<CarType> left_type=new CarTypeServer().GetAll();
request.setAttribute("left_type", left_type);
%>
<c:forEach items="${ left_type }" var="t">
<li><a href="car.jsp?type=${t.id }">${t.type }</a></li>
</c:forEach>
</ul>
</div>
</body>
</html>