?? userdelete.jsp
字號(hào):
<%@ 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(0))||user.userAccess.equals(new Integer(1)))){ response.sendRedirect("../../error/user.html"); }else{ try{%><%String userid=request.getParameter("userid");userStruct us=new userStruct();boolean ok=true;try{Context ctx = new InitialContext(); //look up jndi name Object ref = ctx.lookup("UserController");//cast to Home interface UserControllerHome userControllerHome = (UserControllerHome) PortableRemoteObject.narrow(ref, UserControllerHome.class); UserController userController = userControllerHome.create(); userController.removeRecord(userid);} catch(Exception e){ e.printStackTrace(); ok=false; }if(ok) response.sendRedirect("usercheck.jsp");else response.sendRedirect("../../error/deleteerror.html");%><%}catch(Exception e){ e.printStackTrace(); response.sendRedirect("../../error/deleteerror.html");}}%>
?? 快捷鍵說(shuō)明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -