锘??xml version="1.0" encoding="utf-8" standalone="yes"?>亚洲免费av在线,久久美女艺术照精彩视频福利播放,亚洲视频三区http://www.aygfsteel.com/ytfei/category/3101.htmlzh-cnFri, 02 Mar 2007 03:08:11 GMTFri, 02 Mar 2007 03:08:11 GMT60Hibernate In Action Notehttp://www.aygfsteel.com/ytfei/archive/2005/09/05/12119.html椋炵繑椋炵繑Mon, 05 Sep 2005 14:14:00 GMThttp://www.aygfsteel.com/ytfei/archive/2005/09/05/12119.htmlhttp://www.aygfsteel.com/ytfei/comments/12119.htmlhttp://www.aygfsteel.com/ytfei/archive/2005/09/05/12119.html#Feedback0http://www.aygfsteel.com/ytfei/comments/commentRss/12119.htmlhttp://www.aygfsteel.com/ytfei/services/trackbacks/12119.htmlUsing hibernate.properties for C3P0 connection pool settings:
hibernate.connection.driver_class = org.postgresql.Driver
hibernate.connection.url = jdbc:postgresql://localhost/auctiondb
hibernate.connection.username = auctionuser
hibernate.connection.password = secret
hibernate.dialect = net.sf.hibernate.dialect.PostgreSQLDialect
hibernate.c3p0.min_size=5
hibernate.c3p0.max_size=20
hibernate.c3p0.timeout=300
hibernate.c3p0.max_statements=50
hibernate.c3p0.idle_test_period=3000
2.(Hibernate in a managed environment with an application server)
hibernate.connection.datasource = java:/comp/env/jdbc/AuctionDB
hibernate.transaction.factory_class = \
net.sf.hibernate.transaction.JTATransactionFactory
hibernate.transaction.manager_lookup_class = \
net.sf.hibernate.transaction.JBossTransactionManagerLookup
hibernate.dialect = net.sf.hibernate.dialect.PostgreSQLDialect

緇撳悎spring 鍚庡氨涓嶆槸榪欐牱浜?jiǎn)锛屽彲浠ュ彸spring 鎺у埗transaction & datasource &...

椋炵繑 2005-09-05 22:14 鍙戣〃璇勮
]]>
Struts menu鐨勪嬌鐢紙鍔ㄦ佹暟鎹級(jí)http://www.aygfsteel.com/ytfei/archive/2005/08/30/12079.html椋炵繑椋炵繑Tue, 30 Aug 2005 03:42:00 GMThttp://www.aygfsteel.com/ytfei/archive/2005/08/30/12079.htmlhttp://www.aygfsteel.com/ytfei/comments/12079.htmlhttp://www.aygfsteel.com/ytfei/archive/2005/08/30/12079.html#Feedback0http://www.aygfsteel.com/ytfei/comments/commentRss/12079.htmlhttp://www.aygfsteel.com/ytfei/services/trackbacks/12079.html1.
   鎷瘋礉蹇呰鐨?/SPAN>jar搴撴枃浠跺埌dbMenu\WEB-INF\lib
log4j-1.2.8.jar
struts-menu-2.3.jar 
鎷瘋礉menu-config.xml ,struts-menu.tld 鍒癢EB-INF鐩綍涓?
鍙?qiáng)涓浜涘繀欏葷殑鍥劇墖鍜宩script,css鍒扮浉搴旂殑鐩綍
Images/*.*       
Scripts/    menuExpandable.js xtree.js
Styles/     menuExpandable.css   global.css   xtree.css
2.
淇敼struts-config.xml 鏂囦歡,澧炲姞濡備笅閮ㄥ垎
   <plug-in className="net.sf.navigator.menu.MenuPlugIn">
      
<set-property property="menuConfig"
        value
="/WEB-INF/menu-config.xml"/>
   
plug-in>

3.鑾峰緱鏁版嵁,鏋勯犳爲(wèi)鐘惰彍鍗曪細(xì)
  鏃犺浣曠鏂規(guī)硶鑾峰緱鏁版嵁錛圝DBC錛孒IBERNATE銆傘傘傦級(jí)錛?BR>    鎴戜滑瑕佹瀯閫犵殑鏍?wèi)鐘惰彍鍗曢渶瑕?涓繀欏誨厓绱? 1.鏄劇ず鐨勫悕縐?name) 2.榪炴帴鍒扮殑鐩爣浣嶇疆(location)
  TreeBuilder.java
===========================================================================

/*
 * 鍒涘緩鏃ユ湡 2005-8-6
 */
import ....

import net.sf.navigator.menu.MenuComponent;
import net.sf.navigator.menu.MenuRepository;

/**
 * @author yutengfei
 */
public class TreeBuilder {
 protected final static Log log = LogFactory.getLog("TreeBuilder"); 
 public TreeBuilder() { }

 // 浠ヤ笅浠g爜鐢熸垚鏍?wèi)缁撴瀯锛岒q朵互"treerepository"鍚嶅偍瀛樺湪session 涓?BR>   public static void initialTree(HttpServletRequest request, HttpServlet servlet){
  try {
   MenuRepository repository = new MenuRepository();
   ServletContext context = servlet.getServletContext()
   // Get the repository from the application scope - and copy the
   // DisplayerMappings from it.
   MenuRepository defaultRepository = (MenuRepository) context.getAttribute(MenuRepository.MENU_REPOSITORY_KEY);

   repository.setDisplayers(defaultRepository.getDisplayers()); 

//your code begin
List tree = getTreeDataFromDataBase(); //
// 浜х敓浠庢暟鎹簱涓幏寰楃殑鏁版嵁鍒楄〃(涓涓爲(wèi)鑺傜偣鏄竴涓?FONT size=2>NoteBean 瀵硅薄) 錛岃幏寰楁暟鎹殑鏂規(guī)硶榪欓噷娌℃湁鎻愪緵
for(Iterator it = tree.iterator();it.hasNext();)
{
     MenuComponent mc = new MenuComponent();   //寤虹珛涓涓猰enu瀵硅薄(鏍?wèi)鑺傜?錛岀劧鍚庤緗粬鐨勫睘鎬?BR>            NoteBean row =(NoteBean) it.next()
            String name 
= (String) row.getName()
;
            mc.setName(name);  //璁劇疆鏄劇ず鐨勮妭鐐瑰悕縐?BR>            String parent 
= (String) row.getParentname()
;
            System.
out.println(name + ", parent is: " +
 parent);
            
if (parent != null
) {//瀛樺湪鈥滅埗鈥濊妭鐐?BR>                MenuComponent parentMenu = repository.getMenu(parent);
                
if (parentMenu == null
) {
                    System.
out.println("parentMenu '" + parent + "' doesn't exist!"
);
                    
// create a temporary parentMenu

                    parentMenu = new MenuComponent();
                    parentMenu.setName(parent);
                    repository.addMenu(parentMenu);
                }

                mc.setParent(parentMenu);   //璁劇疆鈥滅埗鈥濊妭鐐?BR>            }
            String title 
= (String) row.getTitle()
;
            mc.setTitle(title);
            String location 
= (String) row.getLocation()
;
            mc.setLocation(location);
            repository.addMenu(mc);
        }
   
request.getSession().setAttribute("treerepository", repository);   //鏁翠釜鏍?wèi)缁撴瀯鍌ㄥ瓨鍦╯ession涓?BR>  } catch (Exception ex) {
   ex.printStackTrace();
  }

 }

}

4.鍓嶅彴jsp鏄劇ず鏍?wèi)鑿滃?BR>
<%try{%>
<%
if (session.getAttribute("treerepository") == null) {
TreeBuilder聽.initialTree(request, (HttpServlet) pageContext.getPage());
聽}%>
<%List list = new ArrayList();
MenuRepository repository = (MenuRepository) session.getAttribute("treerepository");
list = repository.getTopMenus();
String name = "";%>


 <%for (Iterator it = list.iterator(); it.hasNext();) {
聽name = ((MenuComponent) it.next()).getName();%>
 
 <%}%>

<%}catch(Exception e){
e.printStackTrace();
}
%>

5 over



椋炵繑 2005-08-30 11:42

鏂囩珷鏉ユ簮:http://ytfei.cnblogs.com/archive/2005/08/30/225943.html


椋炵繑 2005-08-30 11:42 鍙戣〃璇勮
]]>
主站蜘蛛池模板: 伽师县| 靖边县| 阿克陶县| 辽阳市| 黄山市| 高青县| 宁晋县| 尤溪县| 陇川县| 宁武县| 正蓝旗| 绥芬河市| 济宁市| 平安县| 双流县| 图片| 灯塔市| 钟祥市| 吉首市| 江安县| 华阴市| 临泽县| 张家口市| 开封市| 高邮市| 佛坪县| 平舆县| 集贤县| 噶尔县| 巴彦县| 合阳县| 辽宁省| 昭平县| 城固县| 蚌埠市| 蓬溪县| 施秉县| 尚义县| 浑源县| 嘉兴市| 讷河市|