急求一个网络程序设计。

来源:百度知道 编辑:UC知道 时间:2024/06/18 07:08:44
题是“创建一个登陆页面,要求用户名和密码用常量定义,并且判断密码,提示登录是否成功。”很急,拜托,有能力的人才帮帮忙吧。谢谢啦 ~~~~~···

java写的:
1. login.html
<html>
<head>
<title>login</title>
</head>

<body>
<form name="loginForm" action="login.jsp">
用户名:<input type="text" name="username" />
密码:<input type="password" name="password" />
<input type="submit" value="提交" />
</form>
</body>
</html>

2. Const.java
public class Const {

public static final String USERNAME = "oyc";

public static final String PASSWORD = "123";

}

3. login.jsp
<%@page contentType="text/html;charset=gb2312"%>

<%
String username = request.getParameter("username");
String password = request.getParameter("password");
if(Const.USERNAME.equals(username) && Const.PASSWOR