⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 discardapplyexampro.jsp

📁 《jsp案例开发》这本书的源代码。包括源代码和相关的具体配置操作步骤。非常不错
💻 JSP
字号:
<%@ page    language="java"    contentType="text/html; charset=GBK"    import="imis.*,javax.naming.*,javax.rmi.PortableRemoteObject,java.util.*,java.text.*"%><%    request.setCharacterEncoding("GBK");    session=request.getSession();    userStruct user=(userStruct)session.getAttribute("user");    String applyid = (String)session.getAttribute("proapplyid");    if(user==null){      response.sendRedirect("../../login.html");    }else if(user.userAccess.equals(new Integer(9))||user.userAccess.equals(new Integer(6))){     try{       Context disctx=new InitialContext();       Object disref=disctx.lookup("DiscardController");       DiscardControllerHome discardControllerHome=(DiscardControllerHome) PortableRemoteObject.narrow(disref,DiscardControllerHome.class);       DiscardController discardController=discardControllerHome.create();       discardapplyStruct discardapplystruct = new discardapplyStruct();       discardapplystruct = discardController.getDiscardApplyValue(applyid);       discardapplystruct.replyreason = request.getParameter("replyreason");       String tag = request.getParameter("tag");       Integer year = new Integer(request.getParameter("year")) ;       Integer month = new Integer(request.getParameter("month")) ;       Integer day = new Integer(request.getParameter("day")) ;       discardapplystruct.downtime = new java.sql.Date (year.intValue()-1900,month.intValue()-1,day.intValue());       Context psctx=new InitialContext();       Object psref=psctx.lookup("OfficeUnitController");       OfficeUnitControllerHome officeUnitControllerHome=(OfficeUnitControllerHome) PortableRemoteObject.narrow(psref,OfficeUnitControllerHome.class);       OfficeUnitController officeUnitController=officeUnitControllerHome.create();       Collection coll =officeUnitController.getUnitid(user.unitid);       Iterator qq = coll.iterator();       officeUnitStruct officestr = new officeUnitStruct();       if(qq.hasNext()){           officestr = (officeUnitStruct)qq.next();       }      discardapplystruct.replyunit =officestr.processname;      String deviceid = discardapplystruct.deviceid;      Context ctx = new InitialContext();      Object ref = ctx.lookup("EquipmentControllerEJB");      EquipmentControllerEJBHome equipmentControllerEJBHome = (EquipmentControllerEJBHome) PortableRemoteObject.narrow(ref, EquipmentControllerEJBHome.class);      EquipmentControllerEJB equipmentControllerEJB = equipmentControllerEJBHome.create();      EquipmentJBean equip = new EquipmentJBean();// System.out.println("00000000000000000000000000000000");      equip = equipmentControllerEJB.getEquipmentByDeviceid(deviceid); //System.out.println("111111111111111111111111");      if(user.userAccess.equals(new Integer(6))||user.userAccess.equals(new Integer(7))){        if(tag.equals("1")){          discardapplystruct.replied = new Integer(1);           if((new Double(discardapplystruct.mode)).doubleValue()>10){               equip.setStatus(new Integer(4));           }           else{               equip.setStatus(new Integer(5));           }        }       if(tag.equals("0"))        {       discardapplystruct.replied = new Integer(3);        }      }else{        if(tag.equals("1"))        {          discardapplystruct.replied = new Integer(2);          equip.setStatus(new Integer(5));        }        if(tag.equals("0"))        {        discardapplystruct.replied = new Integer(4);        }      }      boolean ok1 = false;      boolean ok2 = false;      ok1 = equipmentControllerEJB.editEquipment(deviceid,equip); //System.out.println("aaaaaaaaaaaaaaaaaaaaa");      ok2 = discardController.editApply(applyid,discardapplystruct); //System.out.println("bbbbbbbbbbbbbbbbbbbbbbbbbb");      if(ok1&&ok2){          response.sendRedirect("discardapplyexam.jsp");      }else{          response.sendRedirect("../../error/operror.html");      }%><%     }     catch(Exception e){       e.printStackTrace();         response.sendRedirect("../../error/operror.html");     }  }     else{       response.sendRedirect("../../error/access.html");     }    %>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -