【正文】
字段名稱(chēng) 數(shù)據(jù)類(lèi)型 長(zhǎng)度 主外鍵 備注 日志編號(hào) log_id INTEGER 11 PK 自增 模塊編號(hào) type_id INTEGER 11 FK 對(duì)應(yīng)字典類(lèi)型表中的 type_id 操作 operation VARCHAR 50 管理人編號(hào) mgr_id VARCHAR 50 FK 對(duì)應(yīng)人員表的 Staff_id 權(quán)限信息表 權(quán)限信息表 t_authority 的字段定義如表 49 所示。 User user = (User) ().getAttribute(user)。 return (((utf8)))。 !()){ ((password))。 (request, errors)。 (())。 (())。 List list = (r)。 } /** * 該方法是用來(lái)處理人員配置權(quán)限的請(qǐng)求 * param mapping * param form * param request * param response 27 * return */ public ActionForward showEmpRole(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) { UserService userService = ()。 (u, user)。 if (() != null) { empForm = empForm + ()。在動(dòng)手的過(guò)程中,學(xué)習(xí)了一些軟件的使用。 2. 未能實(shí)現(xiàn)一個(gè)賬戶不能同時(shí)登陸的問(wèn)題 解決方案:用 hashtable 來(lái)判斷,每次登陸先把該人的 id 放入 hashtable,當(dāng)該用戶退出的時(shí)候,即時(shí)移除。 ? 在技術(shù)上: 1. 在人員查看計(jì)劃時(shí),顯示時(shí)要從 3 張表讀取屬性用來(lái)綁定。 2. 熟悉了開(kāi)發(fā)的分層結(jié)構(gòu),有利于系統(tǒng)的擴(kuò)展和維護(hù)。 i ()。 User user = (emp)。 ().setAttribute(operList, list)。 (((id)))。 i++) { Emprole er = (Emprole) (i)。 } else { SetRoledetail set = new HashSetRoledetail()。 } if (password == null || ()) { ActionMessages errors = new ActionMessages()。 if(password != null amp。 } } ? MD5 加密代碼如下 : /** * 該類(lèi)是提供密碼加密的方法 * * author Administrator * */ public class EncryptUtil { public static String toMessageDigest(String str) { try { MessageDigest md = (MD5)。 ? 防止非法登錄的代碼如下 /** * 該方法是用來(lái)處理系統(tǒng)安全登錄問(wèn)題 * author Administrator * */ public void doFilter(ServletRequest req, ServletResponse res, FilterChain chain) throws IOException, ServletException { 23 HttpServletRequest request = (HttpServletRequest) req。 圖 42 物理模型圖 數(shù)據(jù)庫(kù)設(shè)計(jì) 部門(mén)信息表 部門(mén)信息表 t_dept 的字段定義如表 41 所示。因此盡量用 0 來(lái)代替 NULL。如果是實(shí)體表則開(kāi)頭用 t,關(guān)系表開(kāi)頭用 r,之后接模塊名,而后是具體的內(nèi)容。主要功能是顯示機(jī)房列表。 如果修改后的角色和已經(jīng)存在的角色相同,會(huì)有提示信息,該角色已經(jīng)存在,請(qǐng)重新設(shè)置。 2. 注銷(xiāo) 用戶退出本系統(tǒng),系統(tǒng)完成 session 的注銷(xiāo),以銷(xiāo)毀用戶在登錄時(shí)保留在 session 中的消息,并返回到登錄界面。 系 統(tǒng) 管 理 日 志 管 理驗(yàn) 證 權(quán) 限日 志 查 詢 e x t e n d s 私 有 e x t e n d s 圖 36 日志管理用例圖 該模塊的前置條件是 具有日志管理的權(quán)限。 刪除機(jī)房時(shí),會(huì)彈出確認(rèn)是否刪除機(jī)房。 2. 部門(mén)管理,能夠?qū)崿F(xiàn)對(duì)部門(mén)的增刪改查。 9 后 臺(tái) 管 理 員管 理 后 臺(tái)登 入 退 出系 統(tǒng) 管 理部 門(mén) 管 理機(jī) 房 管 理人 員 管 理權(quán) 限 管 理普 通 管 理 員日 志 管 理 u s e s u s e s u s e s u s e s e x t e n d s e x t e n d s e x t e n d s e x t e n d s e x t e n d s 系 統(tǒng) 圖 31 系統(tǒng)用例圖 本系統(tǒng)主要完成的任務(wù)如下: 1. 權(quán)限管理,能夠?qū)崿F(xiàn)新增角色,配置角色,刪除角色,配置用戶權(quán)限。 本系統(tǒng) 涉及到以下的關(guān)系 : 部門(mén),機(jī)房,人員等。 ? 可以對(duì) “組 ”進(jìn)行權(quán)限分配 。這些編程語(yǔ)言包括 C、 C++、 Eiffel、 Java、 Perl、 PHP、 7 Python、 Ruby 和 Tcl 等。這樣, Hibernate 就可以與大多數(shù)新的和現(xiàn)有的應(yīng)用平穩(wěn)地集成,而不需要對(duì)應(yīng)用的其余部分作破環(huán)性的改動(dòng)。也就是 Action,執(zhí)行具體的控制器功能,并且調(diào)用相應(yīng)的后臺(tái)模 6 型完成業(yè)務(wù)邏輯。圖 22 顯示了 Struts framework 的體系結(jié)構(gòu): 圖 22 Struts 體系結(jié)構(gòu) 1. 視圖 (View)組件 Struts 中使用 JSP 作為主要的視圖工具。 Struts 框架簡(jiǎn)介 Struts 是一個(gè)簡(jiǎn)化 MVC 開(kāi)發(fā)的非常優(yōu)秀的 Web 應(yīng)用框架,主要采用 JSP、 Servlet 等技術(shù)實(shí)現(xiàn)。利用 MVC設(shè)計(jì)模式開(kāi)發(fā) WEB 應(yīng)用,可以將表示邏輯和業(yè)務(wù)邏輯分離,提高了軟件的可維護(hù)性。標(biāo)準(zhǔn)的 JSP 標(biāo)識(shí)能夠訪問(wèn)和實(shí)例化 JavaBeans 組件,設(shè)置或者檢索組件屬性,下載 Applet,以及執(zhí)行用其他方法更難于編碼和耗時(shí)的功能。如果核心邏輯被封裝在標(biāo)識(shí)和 Beans 中,那么其他人,如 Web 管理人員和頁(yè)面設(shè)計(jì)者,能夠編輯和使用 JSP 頁(yè)面,而不影響內(nèi)容的生成。 第六章總結(jié)系統(tǒng)開(kāi)發(fā)的經(jīng)驗(yàn)以及設(shè)計(jì)過(guò)程中的不足 。 主要介紹了系統(tǒng)分析與設(shè)計(jì)。 內(nèi)容 系統(tǒng)的主要目標(biāo)是通過(guò)權(quán)限來(lái)管理系統(tǒng),通 過(guò)高級(jí)管理員來(lái)配置權(quán)限,然后把權(quán)限分配給人,從而實(shí)現(xiàn)讓權(quán)限控制整個(gè)系統(tǒng)。 關(guān)鍵詞: 權(quán)限管理 , Struts, Hibernate, J2EE I ABSTRACT With the development of the Inter technology, enterprise information construction and the increasing requirements for Web application, the demands for a safe, stable, interactive and maintainable system are being higher. The current system operates according to the users’ limited rights and identities. But this mode of petence administration is relatively inflexible because it cannot expand users’ petence. If there is necessity to expand the petence, firstly it has to be redesigned and redeveloped. However, that kind of systematic design thought could no longer meet the needs of current system. The paper proposes an expansive way to design authority administration, in which the latter can be applied into any system containing the function of authority administration. On the basis of technology, Struts, Hibernate and JSP are used to make the system e into true. The paper mainly demonstrates Struts, Hibernate and JSP technology, analysis and design on the way of UML, building modules by UML technology as well as achievement of the system. The system is divided into five parts, authority administration, department administration, puter room administration, personnel administration and journal administration. All administrations above are managed by the use of distributing the authority of the system. Uses have access to the function module in the leading of related authority. Finally,