markq.jsp
来自「《jsp案例开发》这本书的源代码。包括源代码和相关的具体配置操作步骤。非常不错」· JSP 代码 · 共 55 行
JSP
55 行
<%@ page language="java" contentType="text/html; charset=GBK" import="imis.*,javax.naming.*,javax.rmi.PortableRemoteObject,java.util.*"%><% request.setCharacterEncoding("GBK"); session=request.getSession(); userStruct user=(userStruct)session.getAttribute("user"); if(user==null){ response.sendRedirect("../../login.html"); } else if(user.userAccess.equals(new Integer(1))||user.userAccess.equals(new Integer(0))) response.sendRedirect("../../error/access.html");else{%><% String markname=request.getParameter("markname"); Collection collect=new ArrayList(); Context ctx = new InitialContext(); NavigationmarkStruct ns=new NavigationmarkStruct(); //look up jndi name Object ref = ctx.lookup("NavigationmarkControllerEJB"); //cast to Home interface NavigationmarkControllerEJBHome nscHome = (NavigationmarkControllerEJBHome) PortableRemoteObject.narrow(ref, NavigationmarkControllerEJBHome.class); NavigationmarkControllerEJB nsc = nscHome.create(); Collection tem=nsc.findAll(); Iterator i=tem.iterator(); while(i.hasNext()){ ns=(NavigationmarkStruct)i.next(); Judge jd=new Judge(); if(jd.decide(user.unitid,ns.unitid)) { if(markname.equals("")) {collect.add(ns);} else { if(ns.markname.equals(markname)) collect.add(ns); } } }%><% session = request.getSession(); Collection nm = (Collection)session.getAttribute("nm"); session.setAttribute("nm", collect); response.sendRedirect("navigationmarklist.jsp");%><%}%>
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?