Public void list (it request, HttpServletResponse response)
Throws ServletException, IOException {
The String key=request. The getParameter (" key ");
if (!" ". The equals (key) & amp; & The key!=null) {
Request. SetAttribute (" staffList ", staffService. Search (key));
}
The else {
Request. SetAttribute (" staffList ", staffService. Search (" "));
}
//store the request scope, jump to/ABC/staff/staff_list JSP page
Request. SetAttribute (" page ", PageContext getpages ());
Request. GetRequestDispatcher ("./ABC/staff/staff_list JSP "). The forward (
The request, response);
}
The JSP page
<% @ page language="Java" contentType="text/HTML. Charset=utf-8 "
PageEncoding="utf-8" % & gt;
<% @ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" % & gt; <%
String path=request. GetContextPath ();
String=basePath request. GetScheme () + "://" + request. GetServerName () + ":" + request. GetServerPort () + + "/" path;
%>
<script SRC="https://bbs.csdn.net/abc/js/jquery-1.9.1.min.js" & gt; </script>
<script SRC="https://bbs.csdn.net/abc/js/validate_form.js" & gt; </script>
Var boo=1;
The jQuery ajax ({
Type: "POST",
Url: 'UserServlet'
Cache: false,
Async: false,
Data: {
Method: the "validate",
Username: STR
},
Success: the function (data) {
Boo=data;
}
});
Return boo==0? true : false;
}
</script>
The function v_username (username) {
If (isNull (username. Value)) {
JQuery (" # validate_username "). The text (" * user name cannot be empty). The CSS (" color ", "red");
return false;
}
if (! IsUsername (username. Value)) {
JQuery (" # validate_username "). The text (" * this user name has been registered "). The CSS (" color ", "red");
return false;
}
The else {
JQuery (" # validate_username "). The text (this username available ") "). The CSS (" color ", "green");
}
JQuery (" # validate_email "). The text (" ");
return true;
}
The function v_password (password) {
If (isNull (password. The value)) {
JQuery (" # validate_password "). The text (" * password cannot be empty ");
return false;
}
JQuery (" # validate_password "). The text (" ");
return true;
}
The function v_confirm_password (confirm_password) {
If ((jQuery (" # confirm_password "). Val ()! #=the jQuery (" password "). Val ())) {
JQuery (" # validate_confirm_password "). The text (" * two do not match the password input ");
return false;
}
JQuery (" # validate_confirm_password "). The text (" ");
return true;
}
The function v_name (name) {
If (isNull (name. The value)) {
JQuery (" # validate_name "). The text (" * please enter the name ");
return false;
}
JQuery (" # validate_name "). The text (" ");
return true;
}
</script>
With (thisform)
{
If (
(v_username (username))
& (v_password (password [0])
& (v_confirm_password (confirm_password))
)
return true;
The else
return false;
}
}
</script>
<link rel="STYLESHEET" type="text/CSS" href="https://bbs.csdn.net/abc/codebase/dhtmlxcalendar.css" & gt;
<script SRC="https://bbs.csdn.net/abc/codebase/dhtmlxcalendar.js" & gt; </script>
<script SRC="https://bbs.csdn.net/abc/js/jquery-1.9.1.min.js" language="javascript"/& gt; </script>
<script SRC="https://bbs.csdn.net/abc/js/js.js" language="javascript"/& gt; </script>
<script SRC="https://bbs.csdn.net/abc/ckeditor/ckeditor.js" & gt; </script>
<script>
The function initCKEditor () {
}
Var
MCal,
MDCal,
NewStyleSheet;
Var dateFrom=null;
Var dateTo=null;
Window. The onl oad=function () {
InitCKEditor ();
}
</script>
<style type="text/CSS" & gt;
Body {
The font-family: Arial, Helvetica, sans-serif.
font-size:12px;
color:#666666;
background:#fff;
text-align:center;
}
* {
margin:0;
padding:0;
}
A {
Color: # 1 e7ace;
text-decoration:none;
}
A: hover {
color:#000;
text-decoration:underline;
}
H3 {
font-size:14px;
font-weight:bold;
}
The pre, p {
Color: # 1 e7ace;
Margin: 4 px;
}
Input, select, textarea {
Padding: 1 px;
Margin: 2 px;
font-size:12px;
}
nullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnull