<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ page import="com.statepower.po.DepartmentPO"%>
<%@ page import="com.statepower.basic.Translate"%>
<%
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>
<base href="<%=basePath%>">
<title>中国电力科技研究所管理系统</title>
<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
<meta http-equiv="description" content="This is my page">
<!--
<link rel="stylesheet" type="text/css" href="styles.css">
-->
<script type="text/javascript">
function checkadd(){
if(document.adduserinfo.realname.value == ""){
alert("请输入真实姓名!");
return false;
}
if(document.adduserinfo.username.value == ""){
alert("请输入用户名!");
return false;
}
if(document.adduserinfo.password.value == ""){
alert("请输入密码!");
return false;
}
if(document.adduserinfo.popedom.value == 0){
alert("请选择权限!");
return false;
}
if(document.adduserinfo.department.value= 0){
alert("请选择部门!");
return false;
}
return true;
}
</script>
</head>
<body>
<form action='./UserAddServlet' name='adduserinfo' method='post' onSubmit="return checkadd()">
<table border="1" align="center" >
<tr>
<td align="center"><img src="./image/logo.jpg"></td>
</tr>
<tr height="10">
<td align="center">
真实姓名:<input type="text" name="realname" value="" size="10" maxlength="10">
</td>
</tr>
<tr height="10">
<td align="center">
用 户 名:<input type="text" name="username" value="" size="10" maxlength="10">
</td>
</tr>
<tr height="10">
<td align="center">
密 码:<input type="password" name="password" value="" size="12" maxlength="10">
</td>
</tr>
<tr height="10">
<td align="center">
权 限:<select name="popedom" style="width:100px">
<option value="0">
=请选择=
</option>
<option value="1">
系统管理
</option>
<option value="2">
业务管理
</option>
<option value="3">
财务管理
</option>
<option value="4">
一般管理
</option>
</select>
</td>
</tr>
<tr height="10">
<td align="center">
<%
try {
Translate translate = new Translate();
List list = new ArrayList();
HttpSession se = request.getSession(true);
list = (List) se.getAttribute("alldepartment");
out.println("部 门:<select name='department' style='width:100px'>");
out.println("<option value='0'>=请选择=");
out.println("</option>");
/**输出list对象中封装的DepartmentPO对象的属性 */
for(int i=0;i<list.size();i++){
DepartmentPO temp = (DepartmentPO) list.get(i);
out.println("<option value="+translate.native2Unicode(temp.getDepartmentname())+">");
out.println(translate.native2Unicode(temp.getDepartmentname()));
out.println("</option>");
}
out.println("</select> ");
}catch(Exception e){}
%>
</td>
</tr>
<tr height="10">
<td align="center">
<input type="submit" value="增加" name="ok">
<input type="button" value="返回" name="back" onclick="window.location='setpopedom.jsp'">
</td>
</tr>
</table>
</form>
</body>
</html>
莪想在这个页面中.添加"检测用户名是否存在"的功能.怎么加...请大家多多帮忙,很急...今天莪会一直在线等的....