public String button1_action() { try { // 待做事项:处理按钮单击操作。返回的值是一个导航 // 条件名称,如果它为 Null,则返回到同一页。 String roleName = textField_roleName.getValue().toString().trim(); String memo = (String) textArea_memo.getText(); String[] selectedPopedomList = (String[]) addRemoveList_configPopedom.getSelected(); TRole trole = new TRole(); TRoleUtil.save(roleName, memo); for (int i = 0; (selectedPopedomList != null) && (i < selectedPopedomList.length); i++) { TRolePopedomUtil.saveRolePopedom(roleName, selectedPopedomList[i]); } getSessionBean1().getSessionMap().put("roleName_insertSuccessful", roleName); return "toSuccess"; } catch (HibernateException ex) { return "toDBConnectionError"; } }