traindelone.jsp
来自「这是一个学习jsp的基本程序」· JSP 代码 · 共 43 行
JSP
43 行
<%@ page language="java" contentType="text/html; charset=GBK" import="imis.*,javax.naming.*,javax.rmi.PortableRemoteObject,java.util.*,java.text.*"%><%System.out.println("hhhhhhhhhhhhhhhhhhhhhhh"); request.setCharacterEncoding("GBK"); session=request.getSession(); userStruct user=(userStruct)session.getAttribute("user"); boolean ok =false; if(user==null){ response.sendRedirect("../../login.html"); } else{ if(user.userAccess.equals(new Integer(9))||user.userAccess.equals(new Integer(0))||user.userAccess.equals(new Integer(1))||user.userAccess.equals(new Integer(2))||user.userAccess.equals(new Integer(8))) { response.sendRedirect("../../error/access.html") ; } else { try{ trainStruct trst = new trainStruct(); Context trainctx = new InitialContext(); Object trainref = trainctx.lookup("TrainController"); TrainControllerHome trainControllerHome = (TrainControllerHome) PortableRemoteObject.narrow(trainref, TrainControllerHome.class); TrainController traincontroller = trainControllerHome.create(); String delid=request.getParameter("ajianid"); Integer trainid=new Integer(delid); System.out.println(trainid.intValue()); ok = traincontroller.removeTrain(trainid); if(ok){ response.sendRedirect("trainlist.jsp") ; } } catch(Exception e){ response.sendRedirect("../../error/deleteerror.html") ; } } }%>
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?