<TABLE id=submenu3112 cellSpacing=0 cellPadding=0 width="100%" border=0>
<TBODY> <TR><TD><IMG src="<%=basePath %>member/images/closed。gif"></TD>
<TD height=23><A href="<%=basePath %>member/sq/index。jsp" target="MainFrame">申报信息管理</A></TD></TR>
<TR><TD><IMG src="<%=basePath %>member/images/closed。gif"></TD>
<TD height=23><A href="<%=basePath %>member/sq/add。jsp?method=addsq" target="MainFrame">提交申报信息</A></TD></TR>
<TR><TD><IMG src="<%=basePath %>member/images/closed。gif"></TD>
<TD height=23><A href="<%=basePath %>member/sq/s。jsp" target="MainFrame">查询申报信息</A></TD></TR></TBODY></TABLE></TD></TR></TBODY></TABLE></td></tr>
<tr><td height="5" background="<%=basePath %>member/images/tableline_bottom。jpg" bgcolor="#9BC2ED"></td></tr>
3。4代码设计
因为整个系统的代码太多,不能一一介绍,只在这里简单介绍下用户注册时的操作代码:
try{
String date=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss")。format(Calendar。getInstance()。getTime());
String date2=new SimpleDateFormat("yyyy-MM-dd")。format(Calendar。getInstance()。getTime());
String method=request。getParameter("method")。trim();
ComBean cBean = new ComBean();
HttpSession session = request。getSession();
if(method。equals("mreg")){ //会员注册
String username = request。getParameter("username");
String password = request。getParameter("password");
String realname = request。getParameter("realname");
String sex = request。getParameter("sex");
String age = request。getParameter("age");
String address = request。getParameter("address");
String email = request。getParameter("email");
String str=cBean。getString("select id from member where username='"+username+"'");
if(str==null){
int flag=cBean。comUp("insert into member(username,password,realname,sex,age,address,email,regtime) " +
"values('"+username+"','"+password+"','"+realname+"','"+sex+"','"+age+"','"+address+"','"+email+"','"+date+"')");
if(flag == Constant。SUCCESS){
request。setAttribute("message", "注册成功请登录!");
request。getRequestDispatcher("login。jsp")。forward(request, response);
}
else {
request。setAttribute("message", "操作失败!");
request。getRequestDispatcher("reg。jsp")。forward(request, response);
}
}
else{
request。setAttribute("message", "该用户名已存在!");
request。getRequestDispatcher("reg。jsp")。forward(request, response);
}
}
4 系统实现
4。1开发环境