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

📄 editendentityprofiles.jsp

📁 一套JAVA的CA证书签发系统.
💻 JSP
📖 第 1 页 / 共 2 页
字号:
<html><%@page contentType="text/html"%><%@page errorPage="/errorpage.jsp" import="java.util.*, se.anatom.ejbca.webdist.webconfiguration.EjbcaWebBean,se.anatom.ejbca.ra.raadmin.GlobalConfiguration, se.anatom.ejbca.SecConst               ,se.anatom.ejbca.webdist.rainterface.RAInterfaceBean, se.anatom.ejbca.ra.raadmin.EndEntityProfile, se.anatom.ejbca.webdist.rainterface.EndEntityProfileDataHandler,                 se.anatom.ejbca.ra.raadmin.EndEntityProfileExistsException, se.anatom.ejbca.webdist.hardtokeninterface.HardTokenInterfaceBean, se.anatom.ejbca.hardtoken.HardTokenIssuer,                se.anatom.ejbca.hardtoken.HardTokenIssuerData,  se.anatom.ejbca.webdist.cainterface.CAInterfaceBean"%><jsp:useBean id="ejbcawebbean" scope="session" class="se.anatom.ejbca.webdist.webconfiguration.EjbcaWebBean" /><jsp:useBean id="ejbcarabean" scope="session" class="se.anatom.ejbca.webdist.rainterface.RAInterfaceBean" /><jsp:useBean id="cabean" scope="session" class="se.anatom.ejbca.webdist.cainterface.CAInterfaceBean" /><jsp:useBean id="tokenbean" scope="session" class="se.anatom.ejbca.webdist.hardtokeninterface.HardTokenInterfaceBean" /><%! // Declarations   static final String ACTION                        = "action";  static final String ACTION_EDIT_PROFILES          = "editprofiles";  static final String ACTION_EDIT_PROFILE           = "editprofile";  static final String CHECKBOX_VALUE           = EndEntityProfile.TRUE;//  Used in profiles.jsp  static final String BUTTON_EDIT_PROFILE      = "buttoneditprofile";   static final String BUTTON_DELETE_PROFILE    = "buttondeleteprofile";  static final String BUTTON_ADD_PROFILE       = "buttonaddprofile";   static final String BUTTON_RENAME_PROFILE    = "buttonrenameprofile";  static final String BUTTON_CLONE_PROFILE     = "buttoncloneprofile";  static final String SELECT_PROFILE           = "selectprofile";  static final String TEXTFIELD_PROFILENAME    = "textfieldprofilename";  static final String HIDDEN_PROFILENAME       = "hiddenprofilename"; // Buttons used in profile.jsp  static final String BUTTON_SAVE              = "buttonsave";  static final String BUTTON_CANCEL            = "buttoncancel";   static final String TEXTFIELD_USERNAME             = "textfieldusername";  static final String TEXTFIELD_PASSWORD             = "textfieldpassword";  static final String TEXTFIELD_SUBJECTDN            = "textfieldsubjectdn";  static final String TEXTFIELD_SUBJECTALTNAME       = "textfieldsubjectaltname";  static final String TEXTFIELD_EMAIL                = "textfieldemail";  static final String TEXTFIELD_NOTIFICATIONSENDER   = "textfieldnotificationsender";  static final String TEXTFIELD_NOTIFICATIONSUBJECT  = "textfieldnotificationsubject";  static final String TEXTAREA_NOTIFICATIONMESSAGE  = "textareanotificationmessage";  static final String CHECKBOX_CLEARTEXTPASSWORD          = "checkboxcleartextpassword";  static final String CHECKBOX_ADMINISTRATOR              = "checkboxadministrator";  static final String CHECKBOX_KEYRECOVERABLE             = "checkboxkeyrecoverable";  static final String CHECKBOX_SENDNOTIFICATION           = "checkboxsendnotification";  static final String CHECKBOX_REQUIRED_USERNAME          = "checkboxrequiredusername";  static final String CHECKBOX_REQUIRED_PASSWORD          = "checkboxrequiredpassword";  static final String CHECKBOX_REQUIRED_CLEARTEXTPASSWORD = "checkboxrequiredcleartextpassword";  static final String CHECKBOX_REQUIRED_SUBJECTDN         = "checkboxrequiredsubjectdn";  static final String CHECKBOX_REQUIRED_SUBJECTALTNAME    = "checkboxrequiredsubjectaltname";  static final String CHECKBOX_REQUIRED_EMAIL             = "checkboxrequiredemail";  static final String CHECKBOX_REQUIRED_ADMINISTRATOR     = "checkboxrequiredadministrator";  static final String CHECKBOX_REQUIRED_SENDNOTIFICATION  = "checkboxrequiredsendnotification";  static final String CHECKBOX_REQUIRED_KEYRECOVERABLE    = "checkboxrequiredkeyrecoverable";  static final String CHECKBOX_MODIFYABLE_USERNAME          = "checkboxmodifyableusername";  static final String CHECKBOX_MODIFYABLE_PASSWORD          = "checkboxmodifyablepassword";  static final String CHECKBOX_MODIFYABLE_SUBJECTDN         = "checkboxmodifyablesubjectdn";  static final String CHECKBOX_MODIFYABLE_SUBJECTALTNAME    = "checkboxmodifyablesubjectaltname";  static final String CHECKBOX_MODIFYABLE_EMAIL             = "checkboxmodifyableemail";  static final String CHECKBOX_USE_USERNAME          = "checkboxuseusername";  static final String CHECKBOX_USE_PASSWORD          = "checkboxusepassword";  static final String CHECKBOX_USE_CLEARTEXTPASSWORD = "checkboxusecleartextpassword";  static final String CHECKBOX_USE_SUBJECTDN         = "checkboxusesubjectdn";  static final String CHECKBOX_USE_SUBJECTALTNAME    = "checkboxusesubjectaltname";  static final String CHECKBOX_USE_EMAIL             = "checkboxuseemail";  static final String CHECKBOX_USE_ADMINISTRATOR     = "checkboxuseadministrator";  static final String CHECKBOX_USE_KEYRECOVERABLE    = "checkboxusekeyrecoverable";  static final String CHECKBOX_USE_SENDNOTIFICATION  = "checkboxusesendnotification";  static final String CHECKBOX_USE_HARDTOKENISSUERS  = "checkboxusehardtokenissuers";  static final String SELECT_DEFAULTCERTPROFILE             = "selectdefaultcertprofile";  static final String SELECT_AVAILABLECERTPROFILES          = "selectavailablecertprofiles";  static final String SELECT_DEFAULTTOKENTYPE               = "selectdefaulttokentype";  static final String SELECT_AVAILABLETOKENTYPES            = "selectavailabletokentypes";  static final String SELECT_DEFAULTCA                      = "selectdefaultca";  static final String SELECT_AVAILABLECAS                   = "selectavailablecas";  static final String SELECT_DEFAULTHARDTOKENISSUER         = "selectdefaulthardtokenissuer";  static final String SELECT_AVAILABLEHARDTOKENISSUERS      = "selectavailablehardtokenissuers";  static final String SELECT_ADDSUBJECTDN                   = "selectaddsubjectdn";  static final String BUTTON_DELETESUBJECTDN                = "buttondeletesubjectdn";  static final String BUTTON_ADDSUBJECTDN                   = "buttonaddsubjectdn";  static final String CHECKBOX_SELECTSUBJECTDN              = "checkboxselectsubjectdn";  static final String SELECT_ADDSUBJECTALTNAME              = "selectaddsubjectaltname";  static final String BUTTON_DELETESUBJECTALTNAME           = "buttondeletesubjectaltname";  static final String BUTTON_ADDSUBJECTALTNAME              = "buttonaddsubjectaltname";  static final String CHECKBOX_SELECTSUBJECTALTNAME         = "checkboxselectsubjectaltname";  static final String SELECT_TYPE                         = "selecttype";  String profile = null;  // Declare Language file.%><%   // Initialize environment  String includefile = "endentityprofilespage.jsp";  boolean  triedtoeditemptyprofile   = false;  boolean  triedtodeleteemptyprofile = false;  boolean  profileexists             = false;  boolean  profiledeletefailed       = false;  boolean  cannotcloneempty          = false;  int numberofsubjectdnfields=0;  int numberofsubjectaltnamefields=0;  String value=null;  EndEntityProfile profiledata=null;  int[] fielddata = null;  GlobalConfiguration globalconfiguration = ejbcawebbean.initialize(request,"/ra_functionality/edit_end_entity_profiles");                                             ejbcarabean.initialize(request, ejbcawebbean);                                            cabean.initialize(request, ejbcawebbean);                                            tokenbean.initialize(request, ejbcawebbean);  String THIS_FILENAME            =  globalconfiguration .getRaPath()  + "/editendentityprofiles/editendentityprofiles.jsp";%> <head>  <title><%= globalconfiguration .getEjbcaTitle() %></title>  <base href="<%= ejbcawebbean.getBaseUrl() %>">  <link rel=STYLESHEET href="<%= ejbcawebbean.getCssFile() %>">  <script language=javascript src="<%= globalconfiguration .getAdminWebPath() %>ejbcajslib.js"></script></head><body><%  // Determine action   if( request.getParameter(ACTION) != null){    if( request.getParameter(ACTION).equals(ACTION_EDIT_PROFILES)){      if( request.getParameter(BUTTON_EDIT_PROFILE) != null){          // Display  profilepage.jsp         profile = request.getParameter(SELECT_PROFILE);         if(profile != null){           if(!profile.trim().equals("")){             if(!profile.equals(EndEntityProfileDataHandler.EMPTY_PROFILE)){                ejbcarabean.setTemporaryEndEntityProfile(null);               includefile="endentityprofilepage.jsp";              }else{                triedtoeditemptyprofile=true;                profile= null;             }           }            else{             profile= null;          }         }        if(profile == null){             includefile="endentityprofilespage.jsp";             }      }      if( request.getParameter(BUTTON_DELETE_PROFILE) != null) {          // Delete profile and display profilespage.           profile = request.getParameter(SELECT_PROFILE);          if(profile != null){            if(!profile.trim().equals("")){              if(!profile.equals(EndEntityProfileDataHandler.EMPTY_PROFILE)){                 profiledeletefailed = !ejbcarabean.removeEndEntityProfile(profile);               }else{                triedtodeleteemptyprofile=true;              }            }          }          includefile="endentityprofilespage.jsp";                   }      if( request.getParameter(BUTTON_RENAME_PROFILE) != null){          // Rename selected profile and display profilespage.       String newprofilename = request.getParameter(TEXTFIELD_PROFILENAME);       String oldprofilename = request.getParameter(SELECT_PROFILE);       if(oldprofilename != null && newprofilename != null){         if(!newprofilename.trim().equals("") && !oldprofilename.trim().equals("")){           if(!oldprofilename.equals(EndEntityProfileDataHandler.EMPTY_PROFILE)){              try{               ejbcarabean.renameEndEntityProfile(oldprofilename.trim(),newprofilename.trim());             }catch( EndEntityProfileExistsException e){               profileexists=true;             }           }else{              triedtoeditemptyprofile=true;           }                 }       }             includefile="endentityprofilespage.jsp";       }      if( request.getParameter(BUTTON_ADD_PROFILE) != null){         // Add profile and display profilespage.         profile = request.getParameter(TEXTFIELD_PROFILENAME);         if(profile != null){           if(!profile.trim().equals("")){             try{               ejbcarabean.addEndEntityProfile(profile.trim());             }catch( EndEntityProfileExistsException e){               profileexists=true;             }           }               }         includefile="endentityprofilespage.jsp";       }      if( request.getParameter(BUTTON_CLONE_PROFILE) != null){         // clone profile and display profilespage.       String newprofilename = request.getParameter(TEXTFIELD_PROFILENAME);       String oldprofilename = request.getParameter(SELECT_PROFILE);       if(oldprofilename != null && newprofilename != null){         if(!newprofilename.trim().equals("") && !oldprofilename.trim().equals("")){             if(!oldprofilename.equals(EndEntityProfileDataHandler.EMPTY_PROFILE)){                try{                  ejbcarabean.cloneEndEntityProfile(oldprofilename.trim(),newprofilename.trim());               }catch( EndEntityProfileExistsException e){                 profileexists=true;               }             }else{                cannotcloneempty = true;                             }         }       }                includefile="endentityprofilespage.jsp";       }    }    if( request.getParameter(ACTION).equals(ACTION_EDIT_PROFILE)){

⌨️ 快捷键说明

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