基于java的实验室管理系统_javaweb管理系统项目

基于java的实验室管理系统_javaweb管理系统项目实验室设备管理系统主要包含两个用户角色,一个是超级管理员,可以进行系统的各种管理工作,一个是普通管理员,主要进入系统进行相应的信息查看工作。系统的主要功能包含有:登陆用户的信息修改,系统用户管理,使用设备的用户信息管理,实验设备管理,设备借出管理,设备维修管理,共建记录管理,实验室设备统计(图形报表的形式展示),注销退出,登陆系统。

大家好,又见面了,我是你们的朋友全栈君。如果您正在找激活码,请点击查看最新教程,关注关注公众号 “全栈程序员社区” 获取激活教程,可能之前旧版本教程已经失效.最新Idea2022.1教程亲测有效,一键激活。

Jetbrains全系列IDE使用 1年只要46元 售后保障 童叟无欺

 项目编号:BS-XX-013

本项目基于JSP/Servlet技术实现开发,开发工具采用IDEA或ECLIPSE,数据库采用MYSQL数据库。

首次使用,需要进入src/com/util/DBOK 修改数据库的相关信息,系统设置mysql的用户名为root,密码为root,可以根据需要修改为自己的账户信息。

实验室设备管理系统主要包含两个用户角色,一个是超级管理员,可以进行系统的各种管理工作,一个是普通管理员,主要进入系统进行相应的信息查看工作。系统的主要功能包含有:登陆用户的信息修改,系统用户管理,使用设备的用户信息管理,实验设备管理,设备借出管理,设备维修管理,共建记录管理,实验室设备统计(图形报表的形式展示),注销退出,登陆系统。

下面就部分功能进行功能展示:

用户登陆:

基于java的实验室管理系统_javaweb管理系统项目

登陆后主界面:

基于java的实验室管理系统_javaweb管理系统项目

系统用户管理:

基于java的实验室管理系统_javaweb管理系统项目

用户信息管理:

基于java的实验室管理系统_javaweb管理系统项目

设备信息管理:

基于java的实验室管理系统_javaweb管理系统项目

设备借出管理:

基于java的实验室管理系统_javaweb管理系统项目

设备维修管理:

基于java的实验室管理系统_javaweb管理系统项目

共建记录管理:

基于java的实验室管理系统_javaweb管理系统项目

实验室设备统计:

基于java的实验室管理系统_javaweb管理系统项目

以上是展示的系统部分功能,此项目功能完整,运行无误,比较适合毕业设计使用。

核心代码:

package com.action;
/**
 * 管理员登陆 增加 修改 删除  
 */
import java.io.IOException;
import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.List;
import java.util.StringTokenizer;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;

import com.bean.ComBean; 
import com.util.Constant;
import com.util.MD5;

public class AdminServlet extends HttpServlet {

	/**
	 * Constructor of the object.
	 */
	public AdminServlet() {
		super();
	}

	/**
	 * Destruction of the servlet. <br>
	 */
	public void destroy() {
		super.destroy(); // Just puts "destroy" string in log
		// Put your code here
	}

	/**
	 * The doGet method of the servlet. <br>
	 *
	 * This method is called when a form has its tag value method equals to get.
	 * 
	 * @param request the request send by the client to the server
	 * @param response the response send by the server to the client
	 * @throws ServletException if an error occurred
	 * @throws IOException if an error occurred
	 */
	public void doGet(HttpServletRequest request, HttpServletResponse response)
			throws ServletException, IOException {

		doPost(request,response);
	}

	/**
	 * The doPost method of the servlet. <br>
	 *
	 * This method is called when a form has its tag value method equals to post.
	 * 
	 * @param request the request send by the client to the server
	 * @param response the response send by the server to the client
	 * @throws ServletException if an error occurred
	 * @throws IOException if an error occurred
	 */
	public void doPost(HttpServletRequest request, HttpServletResponse response)
			throws ServletException, IOException {

		response.setContentType(Constant.CONTENTTYPE);
		request.setCharacterEncoding(Constant.CHARACTERENCODING);
		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());
		try{
			String method=request.getParameter("method").trim();
			ComBean cBean = new ComBean();
			HttpSession session = request.getSession();   
			if(method.equals("one")){//用户登录
				String username = request.getParameter("username");
				String password = request.getParameter("password");  
				String sf = request.getParameter("sf");  
				String sql="select realname from admin where username='"+username+"' and  password='"+password+"'  and  sf='"+sf+"' ";
				String str=cBean.getString(sql);
				if(str==null){
					request.setAttribute("message", "登录信息错误!");
					request.getRequestDispatcher("index.jsp").forward(request, response); 
				}
				else{
					session.setAttribute("user", username); session.setAttribute("sf", sf); 
					request.getRequestDispatcher("admin/index.jsp").forward(request, response); 
				}  
			}
			else if(method.equals("uppwd")){//修改密码
				String username=(String)session.getAttribute("user"); 
				String oldpwd = request.getParameter("oldpwd"); 
				String newpwd = request.getParameter("newpwd"); 
				String str=cBean.getString("select id from admin where username='"+username+"' and  password='"+oldpwd+"'");
				if(str==null){
					request.setAttribute("message", "原始密码信息错误!");
					request.getRequestDispatcher("admin/system/editpwd.jsp").forward(request, response); 
				}
				else{
					int flag=cBean.comUp("update admin set password='"+newpwd+"' where username='"+username+"'");
					if(flag == Constant.SUCCESS){ 
						request.setAttribute("message", "操作成功!");
						request.getRequestDispatcher("admin/system/editpwd.jsp").forward(request, response); 
					}
					else { 
						request.setAttribute("message", "操作失败!");
						request.getRequestDispatcher("admin/system/editpwd.jsp").forward(request, response); 
					}
				}
			}
			else if(method.equals("adminexit")){//退出登录
				session.removeAttribute("user");  session.removeAttribute("sf");
				request.getRequestDispatcher("index.jsp").forward(request, response); 
			}
			else if(method.equals("addm")){//增加系统用户
				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 tel = request.getParameter("tel"); 
				String str=cBean.getString("select id from admin where username='"+username+"'");
				if(str==null){ 
						int flag=cBean.comUp("insert into admin(username,password,realname,sex,age,address,tel,addtime ) " +
								"values('"+username+"','"+password+"','"+realname+"','"+sex+"','"+age+"','"+address+"','"+tel+"','"+date+"' )");
						if(flag == Constant.SUCCESS){ 
							request.setAttribute("message", "操作成功!");
							request.getRequestDispatcher("admin/system/index.jsp").forward(request, response); 
						}
						else { 
							request.setAttribute("message", "操作失败!");
							request.getRequestDispatcher("admin/system/index.jsp").forward(request, response); 
						} 
				}
				else{
					request.setAttribute("message", "该用户名已存在!");
					request.getRequestDispatcher("admin/system/index.jsp").forward(request, response); 
				} 
			}
			else if(method.equals("upm")){//修改系统用户
				String id = request.getParameter("id");
				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 tel = request.getParameter("tel");  
				int flag=cBean.comUp("update admin set password='"+password+"',realname='"+realname+"',sex='"+sex+"',age='"+age+"'," +
						"address='"+address+"',tel='"+tel+"' where id='"+id+"'");
				if(flag == Constant.SUCCESS){ 
					request.setAttribute("message", "操作成功!");
					request.getRequestDispatcher("admin/system/index.jsp").forward(request, response); 
				}
				else { 
					request.setAttribute("message", "操作失败!");
					request.getRequestDispatcher("admin/system/index.jsp").forward(request, response); 
				}
			}
			else if(method.equals("delm")){//删除系统用户
				String id = request.getParameter("id");  
				int flag=cBean.comUp("delete from admin where id='"+id+"'");
				if(flag == Constant.SUCCESS){ 
					request.setAttribute("message", "操作成功!");
					request.getRequestDispatcher("admin/system/index.jsp").forward(request, response); 
				}
				else { 
					request.setAttribute("message", "操作失败!");
					request.getRequestDispatcher("admin/system/index.jsp").forward(request, response); 
				}
			} 
			else{//无参数传入转到错误页面
				request.getRequestDispatcher("error.jsp").forward(request, response);
			}
		}catch(Exception e){
			e.printStackTrace();
			request.getRequestDispatcher("error.jsp").forward(request, response);
		}
		
	}

	/**
	 * Initialization of the servlet. <br>
	 *
	 * @throws ServletException if an error occure
	 */
	public void init() throws ServletException {
		// Put your code here
	}

}

package com.action;
import java.io.IOException;
import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.List;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
import com.bean.ComBean;
import com.util.Constant;
public class ComServlet extends HttpServlet {
/**
* Constructor of the object.
*/
public ComServlet() {
super();
}
/**
* Destruction of the servlet. <br>
*/
public void destroy() {
super.destroy(); // Just puts "destroy" string in log
// Put your code here
}
/**
* The doGet method of the servlet. <br>
*
* This method is called when a form has its tag value method equals to get.
* 
* @param request the request send by the client to the server
* @param response the response send by the server to the client
* @throws ServletException if an error occurred
* @throws IOException if an error occurred
*/
public void doGet(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
doPost(request,response);
}
/**
* The doPost method of the servlet. <br>
*
* This method is called when a form has its tag value method equals to post.
* 
* @param request the request send by the client to the server
* @param response the response send by the server to the client
* @throws ServletException if an error occurred
* @throws IOException if an error occurred
*/
public void doPost(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
response.setContentType(Constant.CONTENTTYPE);
request.setCharacterEncoding(Constant.CHARACTERENCODING);
HttpSession session = request.getSession();
ComBean cBean = new ComBean();
String date=new SimpleDateFormat("yyyy-MM-dd").format(Calendar.getInstance().getTime());
String date2=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(Calendar.getInstance().getTime());
String method = request.getParameter("method");
if(method.equals("addview1")){  
//String xm="";String xb="";String nl="";String st="";String hj="";String sfz="";String lxr="";
//String dh="";String zz="";String cw="";String hg="";String rz="";String cy="";
String name = request.getParameter("name"); 
String sex = request.getParameter("sex"); 
String age = request.getParameter("age"); 
String build = request.getParameter("build"); 
int flag = cBean.comUp("insert into view1(name,sex,age,build) values('"+name+"','"+sex+"','"+age+"','"+build+"')");
if(flag == Constant.SUCCESS){ 
request.setAttribute("message", "操作成功!");
request.getRequestDispatcher("admin/view1/index.jsp").forward(request, response);
}
else{
request.setAttribute("message", "操作失败!");
request.getRequestDispatcher("admin/view1/index.jsp").forward(request, response);
} 
} 
else if(method.equals("upview1")){ 修改信息
String id=request.getParameter("id");
String name = request.getParameter("name"); 
String sex= request.getParameter("sex"); 
String age = request.getParameter("age"); 
String build= request.getParameter("build"); 
int flag = cBean.comUp("update view1 set name='"+name+"',sex='"+sex+"',age='"+age+"',build='"+build+"' where id='"+id+"'");
if(flag == Constant.SUCCESS){ 
request.setAttribute("message", "操作成功!");
request.getRequestDispatcher("admin/view1/index.jsp").forward(request, response);
}
else{
request.setAttribute("message", "操作失败!");
request.getRequestDispatcher("admin/view1/index.jsp").forward(request, response);
}  
} 
else if(method.equals("delview1")){//删除信息
String id = request.getParameter("id"); 
int flag = cBean.comUp("delete from view1 where id='"+id+"'");
if(flag == Constant.SUCCESS){ 
request.setAttribute("message", "操作成功!");
request.getRequestDispatcher("admin/view1/index.jsp").forward(request, response);
}
else{
request.setAttribute("message", "系统维护中,请稍后再试!");
request.getRequestDispatcher("admin/view1/index.jsp").forward(request, response);
}
} 
else if(method.equals("addview2")){    
String lend1 = request.getParameter("lend1"); 
String lend2= request.getParameter("lend2"); 
String lend3 = request.getParameter("lend3");  
String lend4 = request.getParameter("lend4"); 
String lend5= request.getParameter("lend5"); 
String lend6 = request.getParameter("lend6");  
String lend7 = request.getParameter("lend7"); 
String lend8 = request.getParameter("lend8"); 
int flag = cBean.comUp("insert into view2(lend1,lend2,lend3,lend4,lend5,lend6,lend7,lend8) values('"+lend1+"','"+lend2+"','"+lend3+"','"+lend4+"','"+lend5+"','"+lend6+"','"+lend7+"','"+lend8+"')");
if(flag == Constant.SUCCESS){ 
request.setAttribute("message", "操作成功!");
request.getRequestDispatcher("admin/view2/index.jsp").forward(request, response);
}
else{
request.setAttribute("message", "操作失败!");
request.getRequestDispatcher("admin/view2/index.jsp").forward(request, response);
} 
} 
else if(method.equals("upview2")){ 
String id=request.getParameter("id");
String lend1= request.getParameter("lend1"); 
String lend2 = request.getParameter("lend2"); 
String lend3 = request.getParameter("lend3"); 
String lend4= request.getParameter("lend4"); 
String lend5 = request.getParameter("lend5"); 
String lend6 = request.getParameter("lend6"); 
String lend7 = request.getParameter("lend7"); 
String lend8 = request.getParameter("lend8"); 
int flag = cBean.comUp("update view2 set lend1='"+lend1+"',lend2='"+lend2+"',lend3='"+lend3+"',lend4='"+lend4+"',lend5='"+lend5+"',lend6='"+lend6+"',lend7='"+lend7+"',lend8='"+lend8+"' where id='"+id+"'");
if(flag == Constant.SUCCESS){ 
request.setAttribute("message", "操作成功!");
request.getRequestDispatcher("admin/view2/index.jsp").forward(request, response);
}
else{
request.setAttribute("message", "操作失败!");
request.getRequestDispatcher("admin/view2/index.jsp").forward(request, response);
}  
} 
else if(method.equals("delview2")){
String id = request.getParameter("id"); 
int flag = cBean.comUp("delete from view2 where id='"+id+"'");
if(flag == Constant.SUCCESS){ 
request.setAttribute("message", "操作成功!");
request.getRequestDispatcher("admin/view2/index.jsp").forward(request, response);
}
else{
request.setAttribute("message", "系统维护中,请稍后再试!");
request.getRequestDispatcher("admin/view2/index.jsp").forward(request, response);
}
} 
else if(method.equals("addview3")){  
String information = request.getParameter("information"); 
String total = request.getParameter("total"); 
String phone = request.getParameter("phone");  
int flag = cBean.comUp("insert into view3(information,total,phone) values('"+information+"','"+total+"','"+phone+"' )");
if(flag == Constant.SUCCESS){ 
request.setAttribute("message", "操作成功!");
request.getRequestDispatcher("admin/view3/index.jsp").forward(request, response);
}
else{
request.setAttribute("message", "操作失败!");
request.getRequestDispatcher("admin/view3/index.jsp").forward(request, response);
} 
} 
else if(method.equals("upview3")){ 
String id=request.getParameter("id");
String information = request.getParameter("information"); 
String total = request.getParameter("total"); 
String phone = request.getParameter("phone");      
int flag = cBean.comUp("update view3 set information='"+information+"',total='"+total+"',phone='"+phone+"' where id='"+id+"'");
if(flag == Constant.SUCCESS){ 
request.setAttribute("message", "操作成功!");
request.getRequestDispatcher("admin/view3/index.jsp").forward(request, response);
}
else{
request.setAttribute("message", "操作失败!");
request.getRequestDispatcher("admin/view3/index.jsp").forward(request, response);
}  
} 
else if(method.equals("delview3")){
String id = request.getParameter("id"); 
int flag = cBean.comUp("delete from view3 where id='"+id+"'");
if(flag == Constant.SUCCESS){ 
request.setAttribute("message", "操作成功!");
request.getRequestDispatcher("admin/view3/index.jsp").forward(request, response);
}
else{
request.setAttribute("message", "系统维护中,请稍后再试!");
request.getRequestDispatcher("admin/view3/index.jsp").forward(request, response);
}
} 		
else if(method.equals("addview4")){   
String number = request.getParameter("number"); 
String name= request.getParameter("name"); 
String area = request.getParameter("area"); 
String price = request.getParameter("price"); 
String status = request.getParameter("status");  
int flag = cBean.comUp("insert into view4(number,name,area,price,status) values('"+number+"','"+name+"','"+area+"','"+price+"','"+status+"')");
if(flag == Constant.SUCCESS){ 
request.setAttribute("message", "操作成功!");
request.getRequestDispatcher("admin/view4/index.jsp").forward(request, response);
}
else{
request.setAttribute("message", "操作失败!");
request.getRequestDispatcher("admin/view4/index.jsp").forward(request, response);
} 
} 
else if(method.equals("upview4")){ 
String id=request.getParameter("id");
String number = request.getParameter("number"); 
String name = request.getParameter("name"); 
String area = request.getParameter("area"); 
String price= request.getParameter("price"); 
String status = request.getParameter("status"); 
int flag = cBean.comUp("update view4 set number='"+number+"',name='"+name+"',area='"+area+"',price='"+price+"',status='"+status+"' where id='"+id+"'");
if(flag == Constant.SUCCESS){ 
request.setAttribute("message", "操作成功!");
request.getRequestDispatcher("admin/view4/index.jsp").forward(request, response);
}
else{
request.setAttribute("message", "操作失败!");
request.getRequestDispatcher("admin/view4/index.jsp").forward(request, response);
}  
} 
else if(method.equals("delview4")){
String id = request.getParameter("id"); 
int flag = cBean.comUp("delete from view4 where id='"+id+"'");
if(flag == Constant.SUCCESS){ 
request.setAttribute("message", "操作成功!");
request.getRequestDispatcher("admin/view4/index.jsp").forward(request, response);
}
else{
request.setAttribute("message", "操作失败!");
request.getRequestDispatcher("admin/view4/index.jsp").forward(request, response);
}
} 
else if(method.equals("addview5")){      
String Repairnumber = request.getParameter("Repairnumber"); 
String BuildName = request.getParameter("BuildName"); 
String Repairdate = request.getParameter("Repairdate"); 
String Repairtime = request.getParameter("Repairtime"); 
String Repaircharge = request.getParameter("Repaircharge");  
int flag = cBean.comUp("insert into view5(Repairnumber,BuildName,Repairdate,Repairtime,Repaircharge) values('"+Repairnumber+"','"+BuildName+"','"+Repairdate+"','"+Repairtime+"','"+Repaircharge+"')");
if(flag == Constant.SUCCESS){ 
request.setAttribute("message", "操作成功!");
request.getRequestDispatcher("admin/view5/index.jsp").forward(request, response);
}
else{
request.setAttribute("message", "系统维护中,请稍后再试!");
request.getRequestDispatcher("admin/view5/index.jsp").forward(request, response);
} 
} 
else if(method.equals("upview5")){ 
String id=request.getParameter("id");
String Repairnumber = request.getParameter("Repairnumber"); 
String BuildName = request.getParameter("BuildName"); 
String Repairdate = request.getParameter("Repairdate"); 
String Repairtime= request.getParameter("Repairtime"); 
String Repaircharge = request.getParameter("Repaircharge"); 
int flag = cBean.comUp("update view5 set Repairnumber='"+Repairnumber+"',BuildName='"+BuildName+"',Repairdate='"+Repairdate+"',Repairtime='"+Repairtime+"',Repaircharge='"+Repaircharge+"' where id='"+id+"'");
if(flag == Constant.SUCCESS){ 
request.setAttribute("message", "操作成功!");
request.getRequestDispatcher("admin/view5/index.jsp").forward(request, response);
}
else{
request.setAttribute("message", "操作失败!");
request.getRequestDispatcher("admin/view5/index.jsp").forward(request, response);
}  
} 
else if(method.equals("delview5")){
String id = request.getParameter("id"); 
int flag = cBean.comUp("delete from view5 where id='"+id+"'");
if(flag == Constant.SUCCESS){ 
request.setAttribute("message", "操作成功!");
request.getRequestDispatcher("admin/view5/index.jsp").forward(request, response);
}
else{
request.setAttribute("message", "操作失败!");
request.getRequestDispatcher("admin/view5/index.jsp").forward(request, response);
}
} 
else if(method.equals("addxz")){   
String lr = request.getParameter("lr"); 
String fy = request.getParameter("fy"); 
String kc = request.getParameter("kc"); 
String zt = request.getParameter("zt"); 
String xx = request.getParameter("xx");  
float sji=Float.parseFloat(fy)-Float.parseFloat(kc);
int flag = cBean.comUp("insert into xz(lr,fy,kc,zt,xx,sji) values('"+lr+"','"+fy+"','"+kc+"','"+zt+"','"+xx+"','"+sji+"' )");
if(flag == Constant.SUCCESS){ 
request.setAttribute("message", "操作成功!");
request.getRequestDispatcher("admin/xz/index.jsp").forward(request, response);
}
else{
request.setAttribute("message", "系统维护中,请稍后再试!");
request.getRequestDispatcher("admin/xz/index.jsp").forward(request, response);
} 
} 
else if(method.equals("upxz")){ 
String id=request.getParameter("id");
String lr = request.getParameter("lr"); 
String fy = request.getParameter("fy"); 
String kc = request.getParameter("kc"); 
String zt = request.getParameter("zt"); 
String xx = request.getParameter("xx"); 
float sji=Float.parseFloat(fy)-Float.parseFloat(kc);
int flag = cBean.comUp("update xz set lr='"+lr+"',fy='"+fy+"',kc='"+kc+"',zt='"+zt+"',xx='"+xx+"',sji='"+sji+"'  where id='"+id+"'");
if(flag == Constant.SUCCESS){ 
request.setAttribute("message", "操作成功!");
request.getRequestDispatcher("admin/xz/index.jsp").forward(request, response);
}
else{
request.setAttribute("message", "操作失败!");
request.getRequestDispatcher("admin/xz/index.jsp").forward(request, response);
}  
} 
else if(method.equals("delxz")){
String id = request.getParameter("id"); 
int flag = cBean.comUp("delete from xz where id='"+id+"'");
if(flag == Constant.SUCCESS){ 
request.setAttribute("message", "操作成功!");
request.getRequestDispatcher("admin/xz/index.jsp").forward(request, response);
}
else{
request.setAttribute("message", "操作失败!");
request.getRequestDispatcher("admin/xz/index.jsp").forward(request, response);
}
} 
else if(method.equals("addhgqj")){  
String lr = request.getParameter("lr"); 
String sj = request.getParameter("sj"); 
String xx = request.getParameter("xx");  
int flag = cBean.comUp("insert into hgqj(lr,sj,xx) values('"+lr+"','"+sj+"','"+xx+"' )");
if(flag == Constant.SUCCESS){ 
request.setAttribute("message", "操作成功!");
request.getRequestDispatcher("admin/hgqj/index.jsp").forward(request, response);
}
else{
request.setAttribute("message", "操作失败!");
request.getRequestDispatcher("admin/hgqj/index.jsp").forward(request, response);
} 
} 
else if(method.equals("uphgqj")){
String id=request.getParameter("id");
String lr = request.getParameter("lr"); 
String sj = request.getParameter("sj"); 
String xx = request.getParameter("xx");      
int flag = cBean.comUp("update hgqj set lr='"+lr+"',sj='"+sj+"',xx='"+xx+"' where id='"+id+"'");
if(flag == Constant.SUCCESS){ 
request.setAttribute("message", "操作成功!");
request.getRequestDispatcher("admin/hgqj/index.jsp").forward(request, response);
}
else{
request.setAttribute("message", "操作失败!");
request.getRequestDispatcher("admin/hgqj/index.jsp").forward(request, response);
}  
} 
else if(method.equals("delhgqj")){
String id = request.getParameter("id"); 
int flag = cBean.comUp("delete from hgqj where id='"+id+"'");
if(flag == Constant.SUCCESS){ 
request.setAttribute("message", "操作成功!");
request.getRequestDispatcher("admin/hgqj/index.jsp").forward(request, response);
}
else{
request.setAttribute("message", "操作失败!");
request.getRequestDispatcher("admin/hgqj/index.jsp").forward(request, response);
}
} 
}
/**
* Initialization of the servlet. <br>
*
* @throws ServletException if an error occure
*/
public void init() throws ServletException {
// Put your code here
}
}

版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 举报,一经查实,本站将立刻删除。

发布者:全栈程序员-用户IM,转载请注明出处:https://javaforall.cn/183811.html原文链接:https://javaforall.cn

【正版授权,激活自己账号】: Jetbrains全家桶Ide使用,1年售后保障,每天仅需1毛

【官方授权 正版激活】: 官方授权 正版激活 支持Jetbrains家族下所有IDE 使用个人JB账号...

(0)
blank

相关推荐

  • 解析CAN的J1939协议PDU报文

    解析CAN的J1939协议PDU报文PF用来确定PDU格式:0——239表示PDU1格式;240——255表示格式2。PDU1格式报文表示向特定或全局地址发送PDU2格式报文表示向全局地址发送PS由PF决定其含义DA表示报文要发送的目标地址GE表示PS在PDU2中与PF的4个最低有效位能够共同确定4096个PDU2格式参数组数据场数据场包含了参数组中的数据内容,通常控制类参数组数据长度等于8;其中

  • gson string转json_string转换成jsonobject

    gson string转json_string转换成jsonobjectCan’tseemtofigurethisout.似乎无法弄清楚。I’mattemptingJSONtreemanipulationinGSON,butIhavea

  • CentOS网络接口配置文件ifcfg-eth详解

    CentOS网络接口配置文件ifcfg-eth详解

    2021年10月18日
  • 什么是Promise,Promise的三种状态[通俗易懂]

    什么是Promise,Promise的三种状态[通俗易懂]什么是Promise对象:Js中进行异步编程的新的解决方案(传统的解决方案——回调函数和事件),用于表示一个异步操作的最终完成(或失败),及其结果值.。 语法上:promise是一个构造函数 简单来说,promise对象用来封装一个异步操作并可以获取其结果语法:newPromise(function(resolve,reject){…}/*e…

  • Kafka集群安装「建议收藏」

    Kafka集群安装「建议收藏」概览1.上传解压2.修改配置文件3.分发到其他节点下4.启动5.测试6.注意准备安装好ZookeeperJDK版本:1.8.0_141Kafka版本:kafka_2.12-1.1.0工具:Xshell5,Xftp51.上传解压首先在master(随意一台)的主机上的/usr下创建kafka文件夹作为安装路径[root@master~]#cd/usr/[roo…

  • 大疆测评攻略

    他说大疆测评也刷人比例还很高总结来网上的有关注意事项都是各方面搬一点,总结一下测评的题主要为:性格测试,逻辑测试,计算题,场景题。这类的题⽬我能给你们的建议只是针对性格测试和场景题这类的主观性题。DJI大疆2019在线测评-知乎https://zhuanlan.zhihu.com/p/76053124大疆招聘网申测评测试笔试题https://zhuanlan.zhihu.com/p/157371591大疆在线测试三段论https://bbs.yingjiesheng.com/thr

发表回复

您的电子邮箱地址不会被公开。

关注全栈程序员社区公众号