My use struts menu dynamic from the database built tree menu design

xiaoxiao2021-03-06  39

About Struts-Menu, there is only two articles of the Blue Sky Website Webmaster to spread, thank you here. 1. "Source Analysis" See http://champion.ewuxi.com/old/opensource/struts-new/strutsmenu.htm 2. "Ibatis Small Code Dynamic Building" See http://www.ewuxi.cn/ithome/ Develop / Deve_LanguageData / 200406 / 489.Html In our project, several tree menus are used, such as organizations and department, system modules, which are based on a single table, I spent a morning, I thought of a design, very Not mature, I hope everyone tells me where, I change it. Use struts-menu2.3 and ibatis2.0, in addition, I also used Spring, class diagrams are as follows: Design Idea: MeunRule is obviously a policy mode, based on a single table, to meet the opening and closing principle, easy There are two parts, one is the corresponding SQLMAP name, and the rules attached to another node (including URL ACTION Target, etc.), the rules are generally determined by their own information, naturally, menule, including these two parts. Of course, if you have recorded these fields in detail in the table, there is no need to work again, and this is not included in our table design. The Menutree class requires the Spring container to inject two properties, one is Menudao, the other is Menule. Too manifest, a type of menu corresponds to a menuTree instance, the main methods in this class are as follows: public meNurepository getMenurePository (Object paramobject) {menurePository repository = new meNurePository (); list items = menudao.getMenuitemlist (menuite.getsqlmapid (), paramobject); MenuItem item; for (int i = 0; i

转载请注明原文地址:https://www.9cbs.com/read-70008.html

New Post(0)