stati_y_1.jsp
来自「这是一个学习jsp的基本程序」· JSP 代码 · 共 87 行
JSP
87 行
<%@ page language="java" contentType="text/html; charset=GBK" import="imis.*,javax.naming.*,javax.rmi.PortableRemoteObject,java.util.*,java.sql.*,java.io.*"%><% request.setCharacterEncoding("GBK"); session=request.getSession(); userStruct user=(userStruct)session.getAttribute("user"); if(user==null){ response.sendRedirect("../../login.html"); } else if(user.userAccess.intValue()==0||user.userAccess.intValue()==1) response.sendRedirect("../../error/access.html"); else{%><%Integer years = new Integer(request.getParameter("years"));EquipmentJBean eqj = null;EquipmentDetailsStruct eqd = null; Context ctx=new InitialContext(); Object ref=ctx.lookup("EquipmentControllerEJB"); EquipmentControllerEJBHome eqHome=(EquipmentControllerEJBHome) PortableRemoteObject.narrow(ref,EquipmentControllerEJBHome.class); EquipmentControllerEJB eqController = eqHome.create(); Collection collect = new ArrayList(); Collection c = new ArrayList(); c = eqController.getEquipmentAll(); Judge jd = new Judge(); Iterator i = c.iterator(); while(i.hasNext()) { eqj = new EquipmentJBean(); eqj = (EquipmentJBean)i.next(); if(jd.decide(user.unitid,eqj.getUnitid())) { eqd = new EquipmentDetailsStruct(); eqd = eqController.getEqdetailsByDeviceid(eqj.getDeviceid()); if(eqd.getChecktime()!=null) { int yy = eqd.getChecktime().getYear()+1900; if(years.intValue()==yy) collect.add(eqj); } } }session.setAttribute("stati_y",collect);session.setAttribute("stati_yt",collect);response.sendRedirect("stati_year.jsp");%><%}%>
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?