使用jquery ui做弹框+使用$.get访问servlet并传参
protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {??// TODO Auto-generated method stub??response.setContentType("text/html");??request.setCharacterEncoding("UTF-8");/*解决中文乱码的问题*/???response.setCharacterEncoding("UTF-8");??????? PrintWriter out = response.getWriter();??????? boolean data=true;??????? ??String name=request.getParameter("name");??int parentid=2;??String comments=request.getParameter("comments");??Connection conn=null;??PreparedStatement ps=null;??ResultSet rs=null;??try{???conn=DBConnection.getConnection();????ps=conn.prepareStatement(???"insert into ddpms_devicetype values(ddpms_devicetype_seq.nextval,?,?,?)");???ps.setString(1, name);???ps.setInt(2,parentid);???ps.setString(3,comments);???int flag=ps.executeUpdate();???if(flag!=1)????data=false;??}catch(Exception e){???e.printStackTrace();??}??finally{???try{????DBConnection.dbClose(conn,ps,rs); //释放数据库连接资源???}catch(Exception e){????e.printStackTrace();???}??}??out.write(String.valueOf(data));?}
??
?
4.?????? Js的退出操作是: return? false;