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

📄 i_usermodify.jsp

📁 《jsp案例开发》这本书的源代码。包括源代码和相关的具体配置操作步骤。非常不错
💻 JSP
字号:
<%@ 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{%><%boolean ok=true;try{String userid=request.getParameter("userid");userStruct us=new userStruct();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();        us=userController.getByUserId(userid);%><%us.userName=request.getParameter("username");us.userAccess=new Integer(request.getParameter("access"));String unit=request.getParameter("unit");officeUnitStruct ous = new officeUnitStruct(); OfficeUnitControllerHome officeUnitControllerHome = null;OfficeUnitController officeUnitController = null; Context ctx1 = new InitialContext();        //look up jndi name        Object ref1 = ctx1.lookup("OfficeUnitController");        //cast to Home interface     officeUnitControllerHome = (OfficeUnitControllerHome) PortableRemoteObject.narrow(ref1, OfficeUnitControllerHome.class);         officeUnitController=officeUnitControllerHome.create();         Collection c=officeUnitController.getProcessName(unit);         Iterator i=c.iterator();         ous=(officeUnitStruct)i.next();us.unitid=ous.unitid;String password=request.getParameter("password");if(!password.equals(""))us.userPass=password;userController.editRecord(us.userId,us);}catch(Exception e){e.printStackTrace();ok=false;}if(ok)response.sendRedirect("usercheck.jsp");else  response.sendRedirect("../../error/modifyerror.html");%><%}catch(Exception e){    e.printStackTrace();    response.sendRedirect("../../error/modifyerror.html");}}%>

⌨️ 快捷键说明

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