锘??xml version="1.0" encoding="utf-8" standalone="yes"?>国产亚洲综合色就色,jiz zz在亚洲,亚洲国产国产综合一区首页http://www.tkk7.com/felicity/category/5829.htmlall gonezh-cnWed, 28 Feb 2007 05:58:08 GMTWed, 28 Feb 2007 05:58:08 GMT60Struts2 鍏ラ棬http://www.tkk7.com/felicity/archive/2007/01/08/92473.htmlall goneall goneMon, 08 Jan 2007 13:59:00 GMThttp://www.tkk7.com/felicity/archive/2007/01/08/92473.htmlhttp://www.tkk7.com/felicity/comments/92473.htmlhttp://www.tkk7.com/felicity/archive/2007/01/08/92473.html#Feedback0http://www.tkk7.com/felicity/comments/commentRss/92473.htmlhttp://www.tkk7.com/felicity/services/trackbacks/92473.html闃呰鍏ㄦ枃

all gone 2007-01-08 21:59 鍙戣〃璇勮
]]>
EJB3.0 + Struts灝忚瘯http://www.tkk7.com/felicity/archive/2006/08/11/62942.htmlall goneall goneFri, 11 Aug 2006 05:52:00 GMThttp://www.tkk7.com/felicity/archive/2006/08/11/62942.htmlhttp://www.tkk7.com/felicity/comments/62942.htmlhttp://www.tkk7.com/felicity/archive/2006/08/11/62942.html#Feedback0http://www.tkk7.com/felicity/comments/commentRss/62942.htmlhttp://www.tkk7.com/felicity/services/trackbacks/62942.html闃呰鍏ㄦ枃

all gone 2006-08-11 13:52 鍙戣〃璇勮
]]>
SSH(Spring + Struts + Hibernate)灝忚瘯 涔嬩笁 http://www.tkk7.com/felicity/archive/2006/07/18/58810.htmlall goneall goneTue, 18 Jul 2006 08:41:00 GMThttp://www.tkk7.com/felicity/archive/2006/07/18/58810.htmlhttp://www.tkk7.com/felicity/comments/58810.htmlhttp://www.tkk7.com/felicity/archive/2006/07/18/58810.html#Feedback0http://www.tkk7.com/felicity/comments/commentRss/58810.htmlhttp://www.tkk7.com/felicity/services/trackbacks/58810.html

鍓嶉潰閫氳繃PlugIn鎴戜滑瀹炵幇浜哠pring Context鐨勫姞杞斤紝涓嶈繃浠呬粎鍔犺澆Context騫舵病鏈変粈涔堝疄闄?
鎰忎箟錛屾垜浠繕闇瑕佷慨鏀歸厤緗紝灝哠truts Action浜ょ粰Spring瀹瑰櫒榪涜綆$悊銆備笅闈㈠皢閫氳繃涓涓猂egsit
瀹炰緥鍔犱互璇存槑銆?

棣栧厛鍑嗗濂絩egist.jsp鍜宭ogin.jsp,鍦╮egist.jsp涓?鐨刦orm鏈塶ame,password,password2,email鍩熴?

鍦╯truts-config.xml涓坊鍔犻厤緗細

<form-bean name="registForm" type="com.lzy.forum.form.RegistForm" />

<action path="/regist" name="registForm"
type="org.springframework.web.struts.DelegatingActionProxy"

validate="true" input="/regist.jsp" scope="request">
<forward name="failure" path="/regist.jsp" />
<forward name="success" path="/login.jsp" />
</action>


RegistForm,RegistAction鎸夌収鍘熸潵Struts鐨勬柟娉曞幓鍐?鎴戝湪RegistAction涓姞鍏ヤ簡涓涓猆serDAO瀵硅薄
userDAO錛岃繖涓璞$敱Spring娉ㄥ叆銆?

<bean name="/regist" class="com.lzy.forum.action.RegistAction"
singleton="false">
<property name="userDAO">
<ref local="userDAO" />
</property>
</bean>

鍩烘湰涓奡SH鐨勬灦鏋勫凡緇忓畬鎴愶紝緇忕‘璁ゅ悗鍙互鑷繁嫻嬭瘯涓涓嬩簡銆傦紙瀹岋級


all gone 2006-07-18 16:41 鍙戣〃璇勮
]]>
SSH(Spring + Struts + Hibernate)灝忚瘯 涔嬩簩http://www.tkk7.com/felicity/archive/2006/07/18/58802.htmlall goneall goneTue, 18 Jul 2006 08:09:00 GMThttp://www.tkk7.com/felicity/archive/2006/07/18/58802.htmlhttp://www.tkk7.com/felicity/comments/58802.htmlhttp://www.tkk7.com/felicity/archive/2006/07/18/58802.html#Feedback0http://www.tkk7.com/felicity/comments/commentRss/58802.htmlhttp://www.tkk7.com/felicity/services/trackbacks/58802.htmlSpring鍜孲truts緇撳悎鏈夊嚑縐嶆柟娉曪紝鎴戦変簡鏈甯哥敤鐨凱lugIn鏂瑰紡錛屽湪struts-config.xml涓姞鍏?br />
<plug-in className="org.springframework.web.struts.ContextLoaderPlugIn">
聽聽聽聽聽聽<set-property property="contextConfigLocation"
聽聽聽聽聽聽聽聽聽聽 聽value="/WEB-INF/action-servlet.xml" />
聽</plug-in>

WEB-INF鐩綍涓嬬殑action-servlet.xml灝辨槸Spring鐨勯厤緗枃浠?涓嬮潰緇欏嚭鐨勬槸鏁翠釜鐨?/font>action-servlet.xml鏂囦歡錛?/font>

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE beans PUBLIC "-//SPRING/DTD BEAN/EN" "<beans>

//Data Source

聽<bean id="dataSource"
聽聽class="org.springframework.jdbc.datasource.DriverManagerDataSource">
聽聽<property name="driverClassName">
聽聽聽<value>com.mysql.jdbc.Driver</value>
聽聽</property>
聽聽<property name="url">
聽聽聽<value>jdbc:mysql://localhost:3306/forum</value>
聽聽</property>
聽聽<property name="username">
聽聽聽<value>test</value>
聽聽</property>
聽聽<property name="password">
聽聽聽<null />
聽聽</property>
聽</bean>

// For Hibernate
<bean id="sessionFactory"
聽聽class="org.springframework.orm.hibernate3.LocalSessionFactoryBean">
聽聽<property name="dataSource">
聽聽聽<ref local="dataSource" />
聽聽</property>
聽聽<property name="mappingResources">
聽聽聽<list>
聽聽聽聽<value>com/lzy/forum/domain/User.hbm.xml</value>
聽聽聽聽<value>com/lzy/forum/domain/Article.hbm.xml</value>
聽聽聽聽<value>com/lzy/forum/domain/Board.hbm.xml</value>
聽聽聽</list>
聽聽</property>
聽聽<property name="hibernateProperties">
聽聽聽<props>
聽聽聽聽<prop key="hibernate.dialect">
聽聽聽聽聽org.hibernate.dialect.MySQLDialect
聽聽聽聽</prop>
聽聽聽聽<prop key="hibernate.show_sql">true</prop>
聽聽聽</props>
聽聽</property>
聽</bean>

聽<bean id="transactionManager"
聽聽class="org.springframework.orm.hibernate3.HibernateTransactionManager">
聽聽<property name="sessionFactory">
聽聽聽<ref local="sessionFactory" />
聽聽</property>
聽</bean>

// For DAO
聽<bean id="userDAO"
聽聽class="com.lzy.forum.dao.impl.UserDAOHibernate">
聽聽<property name="sessionFactory">
聽聽聽<ref local="sessionFactory" />
聽聽</property>
聽</bean>

聽<bean id="boardDAO"
聽聽class="com.lzy.forum.dao.impl.BoardDAOHibernate">
聽聽<property name="sessionFactory">
聽聽聽<ref local="sessionFactory" />
聽聽</property>
聽</bean>

聽<bean id="articleDAO"
聽聽class="com.lzy.forum.dao.impl.ArticleDAOHibernate">
聽聽<property name="sessionFactory">
聽聽聽<ref local="sessionFactory" />
聽聽</property>
聽</bean>

//For Struts Action

聽<bean name="/regist" class="com.lzy.forum.action.RegistAction"
聽聽singleton="false">
聽聽<property name="userDAO">
聽聽聽<ref local="userDAO" />
聽聽</property>

聽</bean>


聽<bean name="/login" class="com.lzy.forum.action.LoginAction"
聽聽singleton="false">
聽聽<property name="userDAO">
聽聽聽<ref local="userDAO" />
聽聽</property>

聽</bean>

聽<bean name="/boardManage"
聽聽class="com.lzy.forum.action.BoardManageAction" singleton="false">
聽聽<property name="userDAO">
聽聽聽<ref local="userDAO" />
聽聽</property>
聽聽<property name="boardDAO">
聽聽聽<ref local="boardDAO" />
聽聽</property>

聽</bean>

聽<bean name="/boardNavigate"
聽聽class="com.lzy.forum.action.BoardNavigateAction" singleton="false">
聽聽<property name="boardDAO">
聽聽聽<ref local="boardDAO" />
聽聽</property>

聽</bean>

聽<bean name="/boardDisplay"
聽聽class="com.lzy.forum.action.BoardDisplayAction" singleton="false">
聽聽<property name="boardDAO">
聽聽聽<ref local="boardDAO" />
聽聽</property>

聽</bean>

聽<bean name="/articleManage"
聽聽class="com.lzy.forum.action.ArticleManageAction" singleton="false">
聽聽<property name="userDAO">
聽聽聽<ref local="userDAO" />
聽聽</property>
聽聽<property name="boardDAO">
聽聽聽<ref local="boardDAO" />
聽聽</property>
聽聽<property name="articleDAO">
聽聽聽<ref local="articleDAO" />
聽聽</property>


聽</bean>


</beans>

緇忚繃榪欐牱鐨勯厤緗箣鍚庯紝Hibernate浜嬪姟浜ょ敱Spring綆$悊錛宻essionFactory浠嶴pring瀹瑰櫒鑾峰緱銆備笅闈㈤氳繃鍏朵腑鐨勪竴涓狣AO瀹炰緥鏉ョ湅鐪嬭繖鏍峰仛甯︽潵鐨勬柟渚褲?br />

//BoardDAO.java

package com.lzy.forum.dao;

import java.util.ArrayList;

import com.lzy.forum.domain.Board;

public interface BoardDAO {

聽public boolean isBoardExist(String name);

聽public void addBoard(Board board);

聽public void deleteBoard(Board board);

聽public Board loadBoard(int id);

聽public Board loadBoard(String name);

聽public Board loadBoardWithArticles(int id);

聽public ArrayList getRootBoardsList();



}


//BoardDAOHibernate.java

package com.lzy.forum.dao.impl;

import java.util.ArrayList;
import java.util.Iterator;
import java.util.ListIterator;
import java.util.Set;

import org.hibernate.Hibernate;
import org.springframework.orm.hibernate3.support.HibernateDaoSupport;

import com.lzy.forum.dao.BoardDAO;
import com.lzy.forum.domain.Board;

public class BoardDAOHibernate extends HibernateDaoSupport implements BoardDAO {

聽public void deleteBoard(Board board) {
聽聽// TODO Auto-generated method stub
聽聽this.getHibernateTemplate().delete(board);
聽}

聽public void addBoard(Board board) {
聽聽// TODO Auto-generated method stub
聽聽this.getHibernateTemplate().saveOrUpdate(board);

聽}

聽public boolean isBoardExist(String name) {
聽聽// TODO Auto-generated method stub
聽聽ArrayList list = (ArrayList) this.getHibernateTemplate().find(
聽聽聽聽"from Board where name = ? ", new Object[] { name });
聽聽if (list.size() > 0) {
聽聽聽// System.out.println("find it");
聽聽聽return true;
聽聽}
聽聽return false;
聽}

聽public Board loadBoard(int id) {
聽聽// TODO Auto-generated method stub
聽聽ArrayList list = (ArrayList) this.getHibernateTemplate().find(
聽聽聽聽"from Board where id = ? ", new Object[] { id });

聽聽Board b = null;
聽聽if (list.size() > 0) {
聽聽聽b = (Board) list.get(0);
聽聽}

聽聽return b;
聽}

聽public Board loadBoard(String name) {
聽聽// TODO Auto-generated method stub
聽聽ArrayList list = (ArrayList) this.getHibernateTemplate().find(
聽聽聽聽"from Board where name = ? ", new Object[] { name });

聽聽Board b = null;
聽聽if (list.size() > 0) {
聽聽聽b = (Board) list.get(0);
聽聽}

聽聽return b;
聽}

聽public ArrayList getRootBoardsList() {
聽聽// TODO Auto-generated method stub
聽聽ArrayList list = (ArrayList) this.getHibernateTemplate().find(
聽聽聽聽"from Board b left join fetch b.ChildBoards where b.Parent = null order by b.id");
聽聽System.out.println(list.size() + " root boards found ");
聽聽

聽聽ListIterator index = list.listIterator();
聽聽while (index.hasNext()) {

聽聽聽Board s = (Board) index.next();
聽聽聽//this.getSession(true);
聽聽聽//Hibernate.initialize(s.getChildBoards());
聽聽聽///*
聽聽聽 Set children聽 = (Set) s.getChildBoards();
聽聽聽 Iterator it = children.iterator();
聽聽聽
聽聽聽 while(it.hasNext()){
聽聽聽 Board b = (Board)it.next();
聽聽聽 //Hibernate.initialize(b);
聽聽聽 System.out.println(b.getName());
聽聽聽 }
聽聽聽 //*/

聽聽聽//System.out.println(children.size() + "child(ren) found ");
聽聽聽//s.setChildBoards(s.getChildBoards());
聽聽}

聽聽return list;
聽}

聽public Board loadBoardWithArticles(int id) {
聽聽// TODO Auto-generated method stub
聽聽ArrayList list = (ArrayList) this.getHibernateTemplate().find(
聽聽聽聽"from Board b left join fetch b.Articles where b.Id = ? ", new Object[] { id });

聽聽Board b = null;
聽聽if (list.size() > 0) {
聽聽聽b = (Board) list.get(0);
聽聽}

聽聽return b;

聽}


}


BoardDAOHibernate緇ф壙 HibernateDaoSupport鍚庯紝閫氳繃getHibernateTemplate()寰楀埌涓涓狧ibernateTemplate瀹炰緥錛岀劧鍚庢墽琛孋RUD鎿嶄綔錛岄潪甯哥畝鍗曘傞渶瑕佹敞鎰忕殑鏄紝鐢變簬鎵ц涓嬈RUD鎿嶄綔鍚庯紝Hibernate session鍏抽棴錛屽鏋滄湁浣跨敤寤惰繜鍔犺澆絳栫暐鐨勫璞℃病鏈夊姞杞斤紝鍦ㄥ悗闈㈢殑Web灞傚緢瀹規槗鍑虹幇濡備笅閿欒錛?br />failed to lazily initialize a collection of role
浠庣綉涓婃悳鍒扮殑瑙e喅鏂規硶鏄疧pen Session In View錛?br /><filter>
聽聽聽聽 <filter-name>hibernateFilter</filter-name>
聽聽聽聽 <filter-class> org.springframework.orm.hibernate3.support.OpenSessionInViewFilter
聽聽聽聽 </filter-class>

聽聽聽聽 <!-- singleSession榛樿涓簍rue,鑻ヨ涓篺alse鍒欑瓑浜庢病鐢∣penSessionInView -->
聽聽聽 <init-param>
聽聽聽聽聽聽 <param-name>singleSession</param-name>
聽聽聽聽聽聽 <param-value>true</param-value>
聽聽聽 </init-param>
聽 </filter>

聽聽 <filter-mapping>
聽聽聽聽 <filter-name>hibernateFilter</filter-name>
聽聽聽聽 <url-pattern>*.do</url-pattern>
聽聽 </filter-mapping>
鎴戣瘯浜嗚瘯錛岃繕鏄湁涓浜涢棶棰橈紝鎵浠ュ悗鏉ヨ繕鏄斁寮冧簡榪欑鏂規硶錛屾墍鏈夊湪Web灞備腑闇瑕佺殑瀵硅薄閮藉繀欏誨湪Business灞備腑鍔犺澆瀹屾垚銆傚涓嬮潰鐨勪唬鐮佹墍紺猴細

ArrayList list = (ArrayList) this.getHibernateTemplate().find(
聽聽聽聽"from Board b left join fetch b.Articles where b.Id = ? ", new Object[] { id });


榪欐牱Hibernate鍜孲pring鐨勭粨鍚堜篃綆楀畬鎴愪簡銆傚叾浠栫殑涓浜汥AO綾誨拰瀹炵幇浠g爜鎴戞病鏈夌粰鍑猴紝浣嗘槸澶у悓灝忓紓錛屽拰Board鐨勫疄鐜扮被浼箋?br />

鏈鍚庡皢鏄疭truts 鍜孲pring鐨勭粨鍚堬紝灝嗗湪涓嬩竴綃囩粰鍑恒傦紙鏈畬寰呯畫錛?/font>







all gone 2006-07-18 16:09 鍙戣〃璇勮
]]>
SSH(Spring + Struts + Hibernate)灝忚瘯 涔嬩竴http://www.tkk7.com/felicity/archive/2006/07/18/58689.htmlall goneall goneTue, 18 Jul 2006 01:54:00 GMThttp://www.tkk7.com/felicity/archive/2006/07/18/58689.htmlhttp://www.tkk7.com/felicity/comments/58689.htmlhttp://www.tkk7.com/felicity/archive/2006/07/18/58689.html#Feedback2http://www.tkk7.com/felicity/comments/commentRss/58689.htmlhttp://www.tkk7.com/felicity/services/trackbacks/58689.html 涔嬪墠瀵筍pring Struts Hibernate閮界◢鏈変簡瑙o紝Spring鐨処OC緇欐垜鐣欎笅浜嗗緢娣辯殑鍗拌薄錛屽鍣ㄧ鐞嗙殑瀵硅薄鐢熸垚
鏂規硶鏋佸ぇ鍦扮畝鍖栦簡紼嬪簭閫昏緫錛孲pring涔熸彁渚涗簡鐢ㄤ簬Web鐨凷pring MVC 妗嗘灦錛岀敱浜庢垜鎰熻鍏舵槗鐢ㄦц繕鏄笉鍙?br />Struts錛屾墍浠ユ垜榪樻槸閫夋嫨Struts浣滀負鍓嶇WEB妗嗘灦錛孒ibernate鎴戜竴鐩存病鏈夊湪Web搴旂敤涓瘯榪囷紝榪欐褰撶劧涓嶄細
閿欒繃鏈轟細浜嗐?/font>


寮鍙戠幆澧冪殑濉斿緩鎴戝氨涓嶅璇翠簡錛屽叿浣撳彲浠ュ弬鑰冩垜浠ュ墠鐨勫嚑綃囨棩蹇椼?/p>

鍦‥clipse涓柊寤轟竴涓姩鎬乄eb宸ョ▼錛屽皢Struts 銆丼pring銆丠ibernate闇瑕佺殑jar閮芥坊鍔犲埌WEB-INF/lib鐩綍涓嬶紝
灝哠truts鏍囩鎵闇鐨則ld鏂囦歡銆乻truts-config.xml鏂囦歡錛堝彲浠ョ敱StrutsIDE鐢熸垚錛夋坊鍔犲埌WEB-INF涓嬶紝鍙﹀鍦?br />姝ょ洰褰曚笅娣誨姞涓涓猄pring鐨勯厤緗枃浠禷pplicationContext.xml銆?/p>


鎴戝弬鑰冪殑渚嬪瓙鏄鏄曠殑銆婃繁鍏ユ祬鍑篐ibernate銆嬩笂鐨勭6绔狅紝寰堝ソ鐨勪竴涓鍧涚ず渚嬨?/p>

棣栧厛鎸夌収涔︿笂鐨凟R妯″瀷錛屽湪鏁版嵁搴擄紙MySQL錛変腑寤虹珛鐩稿簲鐨勬暟鎹簱銆?/p>


create database forum;

use forum;

create table user(
聽id int not null auto_increment primary key,
聽name varchar(50),
聽pwd varchar(50),
聽email varchar(50)

)type=innodb;


create table board(
聽id int not null auto_increment primary key,聽
聽parent_id int,
聽create_by int not null,
聽name varchar(50) not null,
聽remark varchar(255),
聽create_time datetime,

聽index(parent_id),
聽index(create_by),

聽foreign key(parent_id) references board(id) on delete cascade,
聽foreign key(create_by) references user(id) on delete no action

)type=innodb;


create table article(
聽id int not null auto_increment primary key,聽
聽parent_id int ,
聽board_id int not null,
聽article_type int not null,
聽title varchar(255),
聽body text,
聽create_by int not null,

聽create_time datetime,
聽hits int unsigned,
聽bytes int unsigned,
聽last_update_by int not null,
聽last_update_time datetime,

聽index(parent_id),
聽index(board_id),
聽index(create_by),
聽index(last_update_by),

聽foreign key(parent_id) references article(id) on delete no action,
聽foreign key(board_id) references board(id) on delete cascade,
聽foreign key(create_by) references user(id) on delete no action,
聽foreign key(last_update_by) references user(id) on delete no action

)type=innodb;

涔嬪悗錛屾垜閫夋嫨浜嗙敤Hibernate Sychonizer鏉ョ敓鎴愭槧灝勬枃浠跺拰瀹炰綋綾伙紝鐒跺悗瀵圭敓鎴愮殑綾昏繘琛屼慨鏀癸紙鍒犳帀浜嗙敓鎴愮殑Base綾伙級錛?br />瀹為檯涓奌ibernate Sychonizer鐢熸垚鐨勬槧灝勬枃浠朵篃鏈夐敊璇紝闇瑕佷慨鏀癸紝鎴戜篃鏄悗鏉ュ湪浣跨敤涓彂鐜扮殑銆?br />
//User.hbm.xml

<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC
聽"-//Hibernate/Hibernate Mapping DTD//EN"
聽"
http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd " >

<hibernate-mapping package="com.lzy.forum.domain">
聽<class
聽聽name="User"
聽聽table="user"
聽>

聽聽<id
聽聽聽name="Id"
聽聽聽type="integer"
聽聽聽column="id"
聽聽>
聽聽聽<generator class="native"/>
聽聽</id>

聽聽<property
聽聽聽name="Name"
聽聽聽column="name"
聽聽聽type="string"
聽聽聽not-null="false"
聽聽聽length="50"
聽聽/>
聽聽<property
聽聽聽name="Pwd"
聽聽聽column="pwd"
聽聽聽type="string"
聽聽聽not-null="false"
聽聽聽length="50"
聽聽/>
聽聽<property
聽聽聽name="Email"
聽聽聽column="email"
聽聽聽type="string"
聽聽聽not-null="false"
聽聽聽length="50"
聽聽/>

聽聽<set name="ArticlesByLastUpdateBy" inverse="true" lazy="true">
聽聽聽<key column="last_update_by"/>
聽聽聽<one-to-many class="Article"/>
聽聽</set>

聽聽<set name="ArticlesByCreateBy" inverse="true" lazy="true">
聽聽聽<key column="create_by"/>銆?font color="#0000ff">榪欓噷鐨刢reate_by鏄悗鏉ヤ慨鏀圭殑錛孒ibernate Sychonizer鐢熸垚鐨勬湁閿欙紝鍚庨潰鏈夊嚑澶勫悓鏍風殑閿欒銆?/font>
聽聽聽<one-to-many class="Article"/>
聽聽</set>

聽聽<set name="Boards" inverse="true" lazy="true">
聽聽聽<key column="create_by"/>銆愯繖閲岀殑create_by鏄悗鏉ヤ慨鏀圭殑銆?/font>

聽聽聽<one-to-many class="Board"/>
聽聽</set>


聽</class>聽
</hibernate-mapping>

//User.java
package com.lzy.forum.domain;


public class User{
聽private static final long serialVersionUID = 1L;

//聽 primary key
聽private java.lang.Integer id;

聽// fields
聽private java.lang.String name;
聽private java.lang.String pwd;
聽private java.lang.String email;

聽// collections
聽private java.util.Set<Article> articlesByLastUpdateBy;
聽private java.util.Set<Article> articlesByCreateBy;
聽private java.util.Set<Board> boards;


聽public java.util.Set<Article> getArticlesByCreateBy() {
聽聽return articlesByCreateBy;
聽}
聽public void setArticlesByCreateBy(java.util.Set<Article> articlesByCreateBy) {
聽聽this.articlesByCreateBy = articlesByCreateBy;
聽}
聽public java.util.Set<Article> getArticlesByLastUpdateBy() {
聽聽return articlesByLastUpdateBy;
聽}
聽public void setArticlesByLastUpdateBy(
聽聽聽java.util.Set<Article> articlesByLastUpdateBy) {
聽聽this.articlesByLastUpdateBy = articlesByLastUpdateBy;
聽}
聽public java.util.Set<Board> getBoards() {
聽聽return boards;
聽}
聽public void setBoards(java.util.Set<Board> boards) {
聽聽this.boards = boards;
聽}
聽public java.lang.String getEmail() {
聽聽return email;
聽}
聽public void setEmail(java.lang.String email) {
聽聽this.email = email;
聽}
聽public java.lang.Integer getId() {
聽聽return id;
聽}
聽public void setId(java.lang.Integer id) {
聽聽this.id = id;
聽}
聽public java.lang.String getName() {
聽聽return name;
聽}
聽public void setName(java.lang.String name) {
聽聽this.name = name;
聽}
聽public java.lang.String getPwd() {
聽聽return pwd;
聽}
聽public void setPwd(java.lang.String pwd) {
聽聽this.pwd = pwd;
聽}


}

//Board.hbm.xml

<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC
聽"-//Hibernate/Hibernate Mapping DTD//EN"
聽"
http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd " >

<hibernate-mapping package="com.lzy.forum.domain">
聽<class
聽聽name="Board"
聽聽table="board"
聽>
聽聽聽<meta attribute="sync-DAO">false</meta>
聽聽<id
聽聽聽name="Id"
聽聽聽type="integer"
聽聽聽column="id"
聽聽>
聽聽聽<generator class="native"/>
聽聽</id>

聽聽<property
聽聽聽name="Name"
聽聽聽column="name"
聽聽聽type="string"
聽聽聽not-null="true"
聽聽聽length="50"
聽聽/>
聽聽<property
聽聽聽name="Remark"
聽聽聽column="remark"
聽聽聽type="string"
聽聽聽not-null="false"
聽聽聽length="255"
聽聽/>
聽聽<property
聽聽聽name="CreateTime"
聽聽聽column="create_time"
聽聽聽type="timestamp"
聽聽聽not-null="false"
聽聽聽length="19"
聽聽/>
聽聽<many-to-one
聽聽聽name="CreateBy"
聽聽聽column="create_by"
聽聽聽class="User"
聽聽聽not-null="true"
聽聽>
聽聽</many-to-one>
聽聽<many-to-one
聽聽聽name="Parent"
聽聽聽column="parent_id"
聽聽聽class="Board"聽聽聽
聽聽聽not-null="false"
聽聽聽lazy="false">
聽聽</many-to-one>

聽聽<set name="Articles" inverse="true" lazy="true" order-by="id">
聽聽聽<key column="board_id"/>銆愯繖閲岀殑board_id鏄悗鏉ヤ慨鏀圭殑銆?/font>
聽聽聽<one-to-many class="Article"/>
聽聽</set>

聽聽<set name="ChildBoards" inverse="true"聽 lazy="true" order-by="id">
聽聽聽<key column="parent_id"/>銆?/font>榪欓噷鐨刾arent_id鏄悗鏉ヤ慨鏀圭殑銆?br />聽聽聽<one-to-many class="Board"/>
聽聽</set>


聽</class>聽
</hibernate-mapping>

//Board.java
package com.lzy.forum.domain;


public class Board聽 {
聽private static final long serialVersionUID = 1L;

//聽 primary key
聽private java.lang.Integer id;

聽// fields
聽private java.lang.String name;
聽private java.lang.String remark;
聽private java.util.Date createTime;

聽// many to one
聽private com.lzy.forum.domain.User createBy;
聽private com.lzy.forum.domain.Board parent;

聽// collections
聽private java.util.Set<com.lzy.forum.domain.Article> articles;
聽private java.util.Set<com.lzy.forum.domain.Board> childBoards;


聽public java.util.Set<com.lzy.forum.domain.Article> getArticles() {
聽聽return articles;
聽}
聽public void setArticles(java.util.Set<com.lzy.forum.domain.Article> articles) {
聽聽this.articles = articles;
聽}
聽public java.util.Set<com.lzy.forum.domain.Board> getChildBoards() {
聽聽return childBoards;
聽}
聽public void setChildBoards(java.util.Set<com.lzy.forum.domain.Board> childBoards) {
聽聽this.childBoards = childBoards;
聽}
聽public com.lzy.forum.domain.User getCreateBy() {
聽聽return createBy;
聽}
聽public void setCreateBy(com.lzy.forum.domain.User createBy) {
聽聽this.createBy = createBy;
聽}
聽public java.util.Date getCreateTime() {
聽聽return createTime;
聽}
聽public void setCreateTime(java.util.Date createTime) {
聽聽this.createTime = createTime;
聽}
聽public java.lang.Integer getId() {
聽聽return id;
聽}
聽public void setId(java.lang.Integer id) {
聽聽this.id = id;
聽}
聽public java.lang.String getName() {
聽聽return name;
聽}
聽public void setName(java.lang.String name) {
聽聽this.name = name;
聽}
聽public com.lzy.forum.domain.Board getParent() {
聽聽return parent;
聽}
聽public void setParent(com.lzy.forum.domain.Board parent) {
聽聽this.parent = parent;
聽}
聽public java.lang.String getRemark() {
聽聽return remark;
聽}
聽public void setRemark(java.lang.String remark) {
聽聽this.remark = remark;
聽}


}

//Article.hbm.xml

<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC
聽"-//Hibernate/Hibernate Mapping DTD//EN"
聽"
http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd " >

<hibernate-mapping package="com.lzy.forum.domain">
聽<class
聽聽name="Article"
聽聽table="article"
聽>
聽聽<meta attribute="sync-DAO">false</meta>
聽聽<id
聽聽聽name="Id"
聽聽聽type="integer"
聽聽聽column="id"
聽聽>
聽聽聽<generator class="native"/>
聽聽</id>

聽聽<property
聽聽聽name="ArticleType"
聽聽聽column="article_type"
聽聽聽type="integer"
聽聽聽not-null="true"
聽聽聽length="11"
聽聽/>
聽聽<property
聽聽聽name="Title"
聽聽聽column="title"
聽聽聽type="string"
聽聽聽not-null="false"
聽聽聽length="255"
聽聽/>
聽聽<property
聽聽聽name="Body"
聽聽聽column="body"
聽聽聽type="string"
聽聽聽not-null="false"
聽聽/>
聽聽<property
聽聽聽name="Hits"
聽聽聽column="hits"
聽聽聽type="integer"
聽聽聽not-null="false"
聽聽聽length="10"
聽聽/>
聽聽<property
聽聽聽name="Bytes"
聽聽聽column="bytes"
聽聽聽type="integer"
聽聽聽not-null="false"
聽聽聽length="10"
聽聽/>
聽聽<property
聽聽聽name="CreateTime"
聽聽聽column="create_time"
聽聽聽type="timestamp"
聽聽聽not-null="false"
聽聽聽length="19"
聽聽/>
聽聽<property
聽聽聽name="LastUpdateTime"
聽聽聽column="last_update_time"
聽聽聽type="timestamp"
聽聽聽not-null="false"
聽聽聽length="19"
聽聽/>
聽聽<many-to-one
聽聽聽name="LastUpdateBy"
聽聽聽column="last_update_by"
聽聽聽class="User"
聽聽聽not-null="true"
聽聽>
聽聽</many-to-one>
聽聽<many-to-one
聽聽聽name="CreateBy"
聽聽聽column="create_by"
聽聽聽class="User"
聽聽聽not-null="true"
聽聽>
聽聽</many-to-one>
聽聽<many-to-one
聽聽聽name="Parent"
聽聽聽column="parent_id"
聽聽聽class="Article"
聽聽聽not-null="false"
聽聽>
聽聽</many-to-one>
聽聽<many-to-one
聽聽聽name="Board"
聽聽聽column="board_id"
聽聽聽class="Board"
聽聽聽not-null="true"
聽聽>
聽聽</many-to-one>

聽聽<set name="Articles" inverse="true" lazy="false" order-by="id">
聽聽聽<key column="parent_id"/>銆愯繖閲岀殑parent_id鏄悗鏉ヤ慨鏀圭殑銆?/font>
聽聽聽<one-to-many class="Article"/>
聽聽</set>


聽</class>聽
</hibernate-mapping>



//Article.java
package com.lzy.forum.domain;

import java.util.Date;


public class Article聽 {
聽private static final long serialVersionUID = 1L;
聽// primary key
聽private java.lang.Integer id;

聽// fields
聽private java.lang.Integer articleType;
聽private java.lang.String title;
聽private java.lang.String body;
聽private java.lang.Integer hits;
聽private java.lang.Integer bytes;
聽private java.util.Date lastUpdateTime;
聽private java.util.Date createTime;

聽// many to one
聽private com.lzy.forum.domain.User lastUpdateBy;
聽private com.lzy.forum.domain.User createBy;
聽private com.lzy.forum.domain.Article parent;
聽private com.lzy.forum.domain.Board board;

聽// collections
聽private java.util.Set<com.lzy.forum.domain.Article> articles;

聽public java.util.Set<com.lzy.forum.domain.Article> getArticles() {
聽聽return articles;
聽}

聽public void setArticles(java.util.Set<com.lzy.forum.domain.Article> articles) {
聽聽this.articles = articles;
聽}

聽public java.lang.Integer getArticleType() {
聽聽return articleType;
聽}

聽public void setArticleType(java.lang.Integer articleType) {
聽聽this.articleType = articleType;
聽}

聽public com.lzy.forum.domain.Board getBoard() {
聽聽return board;
聽}

聽public void setBoard(com.lzy.forum.domain.Board board) {
聽聽this.board = board;
聽}

聽public java.lang.String getBody() {
聽聽return body;
聽}

聽public void setBody(java.lang.String body) {
聽聽this.body = body;
聽}

聽public java.lang.Integer getBytes() {
聽聽return bytes;
聽}

聽public void setBytes(java.lang.Integer bytes) {
聽聽this.bytes = bytes;
聽}

聽public com.lzy.forum.domain.User getCreateBy() {
聽聽return createBy;
聽}

聽public void setCreateBy(com.lzy.forum.domain.User createBy) {
聽聽this.createBy = createBy;
聽}

聽public java.lang.Integer getHits() {
聽聽return hits;
聽}

聽public void setHits(java.lang.Integer hits) {
聽聽this.hits = hits;
聽}

聽public java.lang.Integer getId() {
聽聽return id;
聽}

聽public void setId(java.lang.Integer id) {
聽聽this.id = id;
聽}

聽public com.lzy.forum.domain.User getLastUpdateBy() {
聽聽return lastUpdateBy;
聽}

聽public void setLastUpdateBy(com.lzy.forum.domain.User lastUpdateBy) {
聽聽this.lastUpdateBy = lastUpdateBy;
聽}

聽public java.util.Date getLastUpdateTime() {
聽聽return lastUpdateTime;
聽}

聽public void setLastUpdateTime(java.util.Date lastUpdateTime) {
聽聽this.lastUpdateTime = lastUpdateTime;
聽}

聽public com.lzy.forum.domain.Article getParent() {
聽聽return parent;
聽}

聽public void setParent(com.lzy.forum.domain.Article parent) {
聽聽this.parent = parent;
聽}

聽public java.lang.String getTitle() {
聽聽return title;
聽}

聽public void setTitle(java.lang.String title) {
聽聽this.title = title;
聽}
聽public java.util.Date getCreateTime(){
聽聽return createTime;
聽}

聽public void setCreateTime(java.util.Date createTime) {
聽聽// TODO Auto-generated method stub
聽聽this.createTime = createTime;
聽}

}

鎺ヤ笅鏉ュ皢浼氬湪web涓姞鍏pring鏀寔鍜屼負瀹炰綋綾繪彁渚汥AO鏀寔銆傦紙鏈畬寰呯畫錛?/font>

all gone 2006-07-18 09:54 鍙戣〃璇勮
]]>
EJB 3.0 瀛︿範絎旇鈥斺擡ntity Beanhttp://www.tkk7.com/felicity/archive/2006/05/20/47229.htmlall goneall goneSat, 20 May 2006 14:38:00 GMThttp://www.tkk7.com/felicity/archive/2006/05/20/47229.htmlhttp://www.tkk7.com/felicity/comments/47229.htmlhttp://www.tkk7.com/felicity/archive/2006/05/20/47229.html#Feedback4http://www.tkk7.com/felicity/comments/commentRss/47229.htmlhttp://www.tkk7.com/felicity/services/trackbacks/47229.html闃呰鍏ㄦ枃

all gone 2006-05-20 22:38 鍙戣〃璇勮
]]>
JavaScript鍜孉pplet浜掔浉璋冪敤http://www.tkk7.com/felicity/archive/2006/05/04/44502.htmlall goneall goneThu, 04 May 2006 01:41:00 GMThttp://www.tkk7.com/felicity/archive/2006/05/04/44502.htmlhttp://www.tkk7.com/felicity/comments/44502.htmlhttp://www.tkk7.com/felicity/archive/2006/05/04/44502.html#Feedback0http://www.tkk7.com/felicity/comments/commentRss/44502.htmlhttp://www.tkk7.com/felicity/services/trackbacks/44502.html Java Script 璋冪敤 java 鍙互鍦ㄧ綉欏甸噷浣跨敤

<script language=javascript>

聽聽聽聽聽聽 document.applet_name.method_name();

</script>

鍙互瀵?/span> applet 榪涜鎺у埗錛屼篃鍙互浠?/span> applet 榪斿洖鍊箋?/span>

Java 璋冪敤 Java Script

闇瑕佸鍏?/span> netscape.javascript.jsobject 榪欎釜綾?/span> 錛坖re/lib/plugin.jar)

姣斿錛?/span>

JSObject window=JSObject.getWindow(this);

JSObject window=(JSObject)window.getMember("document");

鏉ヨ幏鍙栧褰撳墠紿楀彛鐨勬帶鍒舵潈銆?/span>

褰撶偣鍑婚摼鎺?/span> MakeCall 鏃訛紝浼氳Е鍙?/span> Java Script 鍑芥暟

function makeCall(s){

window.document.ctiApplet.testJavascript(s);

alert("call maked!");

}

鍦ㄨ繖涓?/span> Java Script 鍑芥暟涓紝 ctiApplet 鏄竴涓?/span> Applet 錛岃繖鏍峰畬鎴愪簡 java script 璋冪敤

Applet 銆?/span>

浠ヤ笅鏄?/span> ctiApplet 涓殑 testJavascript 鍑芥暟鍜岃繍琛岀粨鏋滐紝鍏朵腑鍙堣皟鐢ㄤ簡 Java Script 銆?br /> public void testJavascript(String msg){

聽聽聽聽聽聽

聽聽聽聽聽聽 try {

聽聽聽聽聽聽聽聽聽聽聽聽聽 // create JSObject

聽聽聽聽聽聽 聽聽聽 聽聽聽聽聽聽 JSObject.getWindow (this).eval ("javascript:alert('Java Script in Applet!')") ;

聽聽聽聽聽聽 }

聽聽聽聽聽聽 catch (Exception ex) {

聽聽聽聽聽聽聽聽聽聽聽聽聽 // Error on create JSObject

聽聽聽聽聽聽 聽聽聽 聽聽聽聽聽聽 showStatus( "Error call javascript err=" + ex );

聽聽聽聽聽聽 }

聽聽聽聽聽聽 System.out.println(msg);

}



all gone 2006-05-04 09:41 鍙戣〃璇勮
]]>
EJB 3.0 瀛︿範絎旇鈥斺斿噯澶囧伐浣?/title><link>http://www.tkk7.com/felicity/archive/2006/03/26/37510.html</link><dc:creator>all gone</dc:creator><author>all gone</author><pubDate>Sun, 26 Mar 2006 15:05:00 GMT</pubDate><guid>http://www.tkk7.com/felicity/archive/2006/03/26/37510.html</guid><wfw:comment>http://www.tkk7.com/felicity/comments/37510.html</wfw:comment><comments>http://www.tkk7.com/felicity/archive/2006/03/26/37510.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.tkk7.com/felicity/comments/commentRss/37510.html</wfw:commentRss><trackback:ping>http://www.tkk7.com/felicity/services/trackbacks/37510.html</trackback:ping><description><![CDATA[ <p> <br />鍦ㄥ紑鍙慐JB3.0 涔嬪墠錛岄鍏堝簲璇ュ幓涓嬭澆瀹冪殑涓涓疄鐜板拰涓涓浉搴旂殑鏀寔EJB3鐨勬湇鍔″櫒錛屾垜涓嬭澆鐨勬槸jboss-EJB-3.0_RC5-PFD鍜孞Boss 4.0.3SP1 錛宩boss-EJB-3.0_RC5-PFD閲岄潰鏈夊畨瑁呰鏄庡拰涓浜涗笉閿欑殑tutorial銆?/p> <p>鏍規嵁瀹夎璇存槑錛孞Boss 4.0.3SP1涓殑EJB3瀹炵幇涓嶆槸鏈鏂扮殑錛屽簲鐢ㄤ笅杞界殑jboss-EJB-3.0_RC5-PFD涓殑涓浜涘寘鍘繪浛鎹€?/p> <p>灝唈boss-EJB-3.0_RC5-PFD涓璴ib鐩綍涓嬬殑 <br />聽(1)ejb3.deployer/<br />聽(2)ejb3-clustered-sfsbcache-service.xml<br />聽(3)ejb3-interceptors-aop.xml<br />聽(4)jboss-aop-jdk50.deployer/<br />鎷瘋礉鍒癹boss-4.0.3SP1/server/all/deploy鐩綍涓?/p> <p>灝唈boss-EJB-3.0_RC5-PFD涓璴ib鐩綍涓嬬殑 <br />聽(5)jboss-remoting.jar<br />聽(6)jboss-serialization.jar<br />聽(7)jboss-j2ee.jar<br />鎷瘋礉鍒癹boss-4.0.3SP1/server/all/lib鐩綍涓?/p> <p> <br />鍒犻櫎jboss-4.0.3SP1/server/all/lib 涓嬬殑<br />聽(1)ejb3-persistence.jar <br />聽(2)hibernate3.jar<br />聽(3)hibernate-annotations.jar<br />聽(4)hibernate-entitymanager.jar<br />鍜宩boss-4.0.3SP1/server/all/deploy涓嬬殑<br />聽(5)jboss-aop.deployer/ <br />鍒版EJB3 鐨勮繍琛岀幆澧冨噯澶囧ソ浜嗭紝浣犲彲浠ョ敤jboss-4.0.3SP1\bin\run -c all 嫻嬭瘯JBoss鏄惁鑳芥垚鍔熷惎鍔ㄣ?/p> <p>鎴戠敤鐨処DE鏄疎clipse 3.2錛孞DK 1.5 錛屼負浜嗘柟渚垮湪Eclipse涓柊寤轟竴涓猆ser Library錛欵JB3_JBoss錛?br />灝唈boss-EJB-3.0_RC5-PFD\lib涓嬬殑<br />聽jboss-j2ee.jar<br />鍜宩boss-EJB-3.0_RC5-PFD\lib\ejb3.deployer涓嬬殑<br />聽ejb3-persistence.jar<br />聽jboss-ejb3x.jar<br />聽jboss-ejb3.jar<br />聽jboss-annotations-ejb3.jar<br />聽hibernate3.jar<br />聽hibernate-annotations.jar<br />聽hibernate-entitymanager.jar<br />娣誨姞鍒癊JB_JBoss涓紝鐜板湪鐜鍩烘湰涓婃惌濂戒簡銆?/p> <img src ="http://www.tkk7.com/felicity/aggbug/37510.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.tkk7.com/felicity/" target="_blank">all gone</a> 2006-03-26 23:05 <a href="http://www.tkk7.com/felicity/archive/2006/03/26/37510.html#Feedback" target="_blank" style="text-decoration:none;">鍙戣〃璇勮</a></div>]]></description></item><item><title>JSP 澶勭悊MySQL鏁版嵁搴撴椂鐨勪腑鏂囬棶棰?/title><link>http://www.tkk7.com/felicity/archive/2005/12/18/24542.html</link><dc:creator>all gone</dc:creator><author>all gone</author><pubDate>Sun, 18 Dec 2005 14:57:00 GMT</pubDate><guid>http://www.tkk7.com/felicity/archive/2005/12/18/24542.html</guid><wfw:comment>http://www.tkk7.com/felicity/comments/24542.html</wfw:comment><comments>http://www.tkk7.com/felicity/archive/2005/12/18/24542.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.tkk7.com/felicity/comments/commentRss/24542.html</wfw:commentRss><trackback:ping>http://www.tkk7.com/felicity/services/trackbacks/24542.html</trackback:ping><description><![CDATA[<P>浠ュ墠閬囧埌JSP 澶勭悊MySQL鏁版嵁搴撴椂鐨勪腑鏂囬棶棰樻椂錛岄噰鍙栫殑鏄緢絎ㄧ殑涓縐嶆柟娉曪紝鐩存帴鐢ㄥ瓧絎︿覆緙栫爜杞崲鍑芥暟榪涜杞崲錛岃繖嬈′粠緗戜笂鎼滀簡涓涓嬶紝鎵懼埌浜嗕竴涓嬌鐢‵ilter鐨勫彲琛屾柟娉曘傚湪Tomcat 5.5錛?MySQL4.0.16涓嬮氳繃銆?BR><BR>filter綾繪簮鐮佹槸浠庣綉涓婃壘鐨勶紝濡備笅<BR>/**<BR> * <BR> */<BR>package com.lzy;</P> <P>import java.io.IOException;<BR>import javax.servlet.Filter;<BR>import javax.servlet.FilterChain;<BR>import javax.servlet.FilterConfig;<BR>import javax.servlet.ServletException;<BR>import javax.servlet.ServletRequest;<BR>import javax.servlet.ServletResponse;</P> <P>/**<BR> * @author lzy<BR> *<BR> */<BR>public class SetCharacterEncodingFilter implements Filter {<BR> <BR> protected String encoding = null;<BR>    protected FilterConfig filterConfig = null;<BR>    protected boolean ignore = true;</P> <P><BR> /* (non-Javadoc)<BR>  * @see javax.servlet.Filter#init(javax.servlet.FilterConfig)<BR>  */<BR> public void init(FilterConfig filterConfig) throws ServletException {<BR>  // TODO Auto-generated method stub<BR>  this.filterConfig = filterConfig;<BR>     this.encoding = filterConfig.getInitParameter("encoding");<BR>     String value = filterConfig.getInitParameter("ignore");<BR>     if (value == null)<BR>      this.ignore = true;<BR>     else if (value.equalsIgnoreCase("true"))<BR>      this.ignore = true;<BR>     else if (value.equalsIgnoreCase("yes"))<BR>      this.ignore = true;<BR>     else<BR>      this.ignore = false;</P> <P><BR> }</P> <P> /* (non-Javadoc)<BR>  * @see javax.servlet.Filter#doFilter(javax.servlet.ServletRequest, javax.servlet.ServletResponse, javax.servlet.FilterChain)<BR>  */<BR> public void doFilter(ServletRequest request, ServletResponse response,<BR>   FilterChain chain) throws IOException, ServletException {<BR>  <BR>  // TODO Auto-generated method stub<BR>  if (ignore || (request.getCharacterEncoding() == null)) {<BR>   String encoding = selectEncoding(request);<BR>   if (encoding != null)<BR>    request.setCharacterEncoding(encoding);<BR>  }<BR>  chain.doFilter(request, response);<BR> }</P> <P> /* (non-Javadoc)<BR>  * @see javax.servlet.Filter#destroy()<BR>  */<BR> public void destroy() {<BR>  // TODO Auto-generated method stub<BR>  <BR>  this.encoding = null;<BR>     this.filterConfig = null;</P> <P><BR> }<BR> <BR>  protected String selectEncoding(ServletRequest request) {</P> <P>         return (this.encoding); </P> <P>     }</P> <P><BR>}</P> <P>鍦╳eb.xml 鏂囦歡涓綔濡備笅璁劇疆錛氾紙鎴戜嬌鐢ㄧ殑鏄疭truts妗嗘灦錛?BR><filter><BR><filter-name>Encoding</filter-name><BR><filter-class>com.lzy.SetCharacterEncodingFilter</filter-class><BR><init-param><BR><param-name>encoding</param-name><BR><param-value>GBK</param-value><BR></init-param><BR></filter></P> <P><filter-mapping><BR><filter-name>Encoding</filter-name><BR><servlet-name>action</servlet-name><BR></filter-mapping><BR><filter-mapping><BR><filter-name>Encoding</filter-name><BR><url-pattern>*.jsp</url-pattern><BR></filter-mapping><BR><BR><BR>鏈鍚庯紝榪炴帴鏁版嵁搴撴椂錛屼嬌鐢ㄤ笅闈㈢殑url錛?BR>jdbc:mysql://localhost:3306/鏁版嵁搴撳悕?useUnicode=true&characterEncoding=GBK</P><img src ="http://www.tkk7.com/felicity/aggbug/24542.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.tkk7.com/felicity/" target="_blank">all gone</a> 2005-12-18 22:57 <a href="http://www.tkk7.com/felicity/archive/2005/12/18/24542.html#Feedback" target="_blank" style="text-decoration:none;">鍙戣〃璇勮</a></div>]]></description></item><item><title>Spring涔婬ello Worldhttp://www.tkk7.com/felicity/archive/2005/12/14/23948.htmlall goneall goneWed, 14 Dec 2005 14:07:00 GMThttp://www.tkk7.com/felicity/archive/2005/12/14/23948.htmlhttp://www.tkk7.com/felicity/comments/23948.htmlhttp://www.tkk7.com/felicity/archive/2005/12/14/23948.html#Feedback0http://www.tkk7.com/felicity/comments/commentRss/23948.htmlhttp://www.tkk7.com/felicity/services/trackbacks/23948.html1.涓嬭澆Spring鐩稿叧鐨勫紑鍙戝寘
涓嬭澆鍦板潃錛?A >http://sourceforge.net/project/showfiles.php?group_id=73357
鏈塻pring-framework-1.2.6-with-dependencies.zip錛屼竴鍊嬫槸spring-framework-1.2.6.zip錛屾渶濂戒笅杞絯ith錛峝ependencies鐨勶紝閲岄潰鏈夊彟澶栦竴浜涢檮鍔犲寘錛屼笅杞藉悗瑙e帇緙╋紝dist鐩綍涓嬫槸spring鑷韓鐨刯ar錛宭ib鐩綍涓嬫槸闄勫姞鐨刯ar銆?BR>2.鏂板緩Java Project錛屽皢spring.jar錛坉ist鐩綍涓嬶級鍜宑ommons-logging.jar錛坙ib鐩綍涓嬶級娣誨姞鍒皃roject鐨刡uild path涓?BR>3.鏂板緩POJO Bean綾伙細HelloBean
//HelloBean.java
/**
 *
 */
package com.lzy;

/**
 * @author lzy
 *
 */
public class HelloBean{
 
 private String hello;
 
 public void sayHello(){
  System.out.println(this.getHello());
 }

 /**
  * @return Returns the hello.
  */
 public String getHello() {
  return hello;
 }

 /**
  * @param hello The hello to set.
  */
 public void setHello(String hello) {
  this.hello = hello;
 }
 

}


4.鏂板緩鏂囦歡bean.xml錛屽皢鍦ㄨ繖涓猉ML鏂囦歡涓負涓涓狧elloBean鐨勫疄渚嬬殑hello灞炴ц祴鍊箋?BR>//bean.xml
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" "<beans>
<description>Spring Quick Start</description>
<bean id="helloBean" class="com.lzy.HelloBean">
  <property name="hello">
   <value>hello world</value>
  </property>
</bean>
</beans>

5.鏂板緩嫻嬭瘯綾伙細TestSpring
//TestSpring.java
/**
 *
 */
package com.lzy;

import java.util.Locale;

import org.springframework.context.ApplicationContext;
import org.springframework.context.support.FileSystemXmlApplicationContext;

/**
 * @author lzy
 *
 */
public class TestSpring {

 /**
  * @param args
  */
 public static void main(String[] args) {
  // TODO Auto-generated method stub
  
  ApplicationContext ctx=new FileSystemXmlApplicationContext("bean.xml");
    HelloBean hello=(HelloBean)ctx.getBean("helloBean");
  hello.sayHello();
 }

}


6.榪愯嫻嬭瘯綾伙細
    濡傛灉娌℃湁鍑洪敊錛岃緭鍑轟腑灝嗕細鐪嬪埌鈥渉ello world鈥濄?BR>



all gone 2005-12-14 22:07 鍙戣〃璇勮
]]>
Eclipse涓婬ibernate鍏ラ棬http://www.tkk7.com/felicity/archive/2005/12/10/23253.htmlall goneall goneSat, 10 Dec 2005 04:50:00 GMThttp://www.tkk7.com/felicity/archive/2005/12/10/23253.htmlhttp://www.tkk7.com/felicity/comments/23253.htmlhttp://www.tkk7.com/felicity/archive/2005/12/10/23253.html#Feedback3http://www.tkk7.com/felicity/comments/commentRss/23253.htmlhttp://www.tkk7.com/felicity/services/trackbacks/23253.html
1.寮鍙戠幆澧?
     Eclipse 3.2錛婱ySQL 4.0.16錛婬ibernate3.0
    棣栧厛搴旇瀹夎濂紼clipse鍜孧ySQL錛屾澶栧噯澶囧ソMySQL鐨凧DBC Driver鍜孒ibernate3.0,鐩稿叧涓嬭澆鍦板潃濡備笅錛?BR>     Eclipse SDK錛?
        http://www.eclipse.org/downloads/index.php 
       MySQL鍙奙ySQL鐨凧DBC Driver:
           http://www.mysql.org
       Hibernate:
          http://www.hibernate.org
       姝ゅ鎴戣繕瀹夎浜咵clipse鐨勪竴涓狧ibernate鎻掍歡錛?BR>     Hibernate synchronizer
           http://hibernatesynch.sourceforge.net


       Plugin Search:
         http://eclipse-plugins.2y.net/eclipse/search.jsp 

       Hibernate synchronizer鎻掍歡鐨勫畨瑁呭拰閰嶇疆鏈夐棶棰樿鐩存帴Google銆?

     鍦ㄥ伐紼嬩腑鍏跺疄鍙敤鍒頒簡Hibernate synchronizer鎻掍歡鐨勪竴閮ㄥ垎鍔熻兘錛孒ibernate渚濊禆鐨勭浉鍏砵ar鍖呮渶濂借繕鏄墜鍔ㄦ坊鍔狅紝鍥犱負鏈寮濮嬬敤Hibernate synchronizer娣誨姞鏃舵繪槸鍙戠敓閿欒銆?BR>     灝嗕笅杞界殑Mysql driver鍜孒ibernate鍖呰В鍘嬬緝錛屾垜浠渶瑕佺殑鍙槸閲岄潰鐩稿叧鐨刯ar錛屽湪Eclipse涓柊寤篗ysql_Driver鍜孒ibernate涓や釜user library,灝唌ysql-connector-java-3.0.15-ga-bin.jar鍔犲叆Mysql_Driver涓紝灝唄ibernate3.jar錛?BR>錛宭og4j-1.2.11.jar錛宎ntlr-2.7.5H3.jar錛宎sm.jar錛宎sm-attrs.jar錛宑glib-2.1.2.jar錛宑ommons-collections-2.1.1.jar錛宑ommons-logging-1.0.4.jar錛宒om4j-1.6.1.jar錛宔hcache-1.1.jar錛宩ta.jar鍔犲叆鍒癏ibernate涓?/P>

2.寮濮?
鍦∕ysql涓柊寤簍est鏁版嵁搴擄紙Mysql鍏跺疄鏈変釜絀虹殑test鏁版嵁搴擄級錛岀劧鍚庢柊寤轟笅闈㈢殑Table

create table user (
 id int(10) not null auto_increment primary key,
 name varchar(20) not null,
 password varchar(20) not null,
 email varchar(50),
 address varchar(100)
)type=innodb;


鏂板緩Java Project錛屽皢Mysql_Driver,Hibernate涓や釜user library娣誨姞鍒拌宸ョ▼鐨刯ava build path涓?/P>

鏂板緩涓庢暟鎹〃瀵瑰簲鐨凱OJO綾伙細User鍜孋ontact

/**
 *
 * 
 */
package com.user;

/**
 * @author lzy
 *
 */
public class User{
    private Integer id;
    private String name;
    private String password;
    private Contact contact;
   

 /**
  * @return Returns the id.
  */
 public Integer getId() {
  return id;
 }
 /**
  * @param id The id to set.
  */
 public void setId(Integer id) {
  this.id = id;
 }
 /**
  * @return Returns the name.
  */
 public String getName() {
  return name;
 }
 /**
  * @param name The name to set.
  */
 public void setName(String name) {
  this.name = name;
 }
 /**
  * @return Returns the password.
  */
 public String getPassword() {
  return password;
 }
 /**
  * @param password The password to set.
  */
 public void setPassword(String password) {
  this.password = password;
 }
 /**
  * @return Returns the contact.
  */
 public Contact getContact() {
  return contact;
 }
 /**
  * @param contact The contact to set.
  */
 public void setContact(Contact contact) {
  this.contact = contact;
 }
   
   
}
/**
 *
 */
package com.user;

/**
 * @author lzy
 *
 */
public class Contact {
 private String email;
    private String address;

 /**
  * @return Returns the address.
  */
 public String getAddress() {
  return address;
 }
 /**
  * @param address The address to set.
  */
 public void setAddress(String address) {
  this.address = address;
 }
 /**
  * @return Returns the email.
  */
 public String getEmail() {
  return email;
 }
 /**
  * @param email The email to set.
  */
 public void setEmail(String email) {
  this.email = email;
 }
}

涔嬪悗鍙互鐢╯ynchronizer鎻掍歡鐢熸垚Hibernate閰嶇疆鏂囦歡鍜屾槧灝勬枃浠訛紙鐩稿叧榪囩▼鍙互鍙傝?A >http://www.ideagrace.com/html/doc/2005/08/01/00315.html)錛屼笉榪囨槧灝勬枃浠跺繀欏葷◢浣滀慨鏀廣?/P>

hibernate.cfg.xml
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE hibernate-configuration
    PUBLIC "-//Hibernate/Hibernate Configuration DTD//EN"
    "

<hibernate-configuration>
    <session-factory >

  <!-- local connection properties -->
  <property name="hibernate.connection.url">jdbc:mysql://localhost/test</property>
  <property name="hibernate.connection.driver_class">com.mysql.jdbc.Driver</property>
  <property name="hibernate.connection.username"></property>
  <property name="hibernate.connection.password"></property>
  <!-- property name="hibernate.connection.pool_size"></property -->

  <!-- dialect for MySQL -->
        <property name="dialect">org.hibernate.dialect.MySQLDialect</property>

        <property name="hibernate.show_sql">True</property>
        <property name="hibernate.transaction.factory_class">org.hibernate.transaction.JDBCTransactionFactory</property>
     <mapping resource="User.hbm.xml"/>


    </session-factory>
</hibernate-configuration>

User.hbm.xml

<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC
 "-//Hibernate/Hibernate Mapping DTD//EN"
 "

<hibernate-mapping package="com.user">
 <class
  name="User"
  table="user"
 >
  <id
   name="Id"
   type="integer"
   column="id"
  >
   <generator class="native"/>
  </id>

  <property
   name="Name"
   column="name"
   type="string"
   not-null="true"
   length="20"
  />
  <property
   name="Password"
   column="password"
   type="string"
   not-null="true"
   length="20"
  />
  <component name="Contact" class="Contact">
   <property
   name="Email"
   column="email"
   type="string"
   not-null="false"
   length="50"
  />
  <property
   name="Address"
   column="address"
   type="string"
   not-null="false"
   length="100"
  />
  </component>
  


 </class> 
</hibernate-mapping>

 

3.嫻嬭瘯
娣誨姞涓涓祴璇曠被錛欻ibernateTest

package com.user;

import java.util.List;
import java.util.ListIterator;

import org.hibernate.*;
import org.hibernate.cfg.*;

public class HibernateTest {
    public static void main(String[] args) throws HibernateException {
        SessionFactory sessionFactory = new Configuration().configure().buildSessionFactory();
       
        //
        //testInsert(sessionFactory);
       
        //
        testQuery(sessionFactory);
       
         
        sessionFactory.close();
       
    }
    public static void testInsert( SessionFactory sessionFactory )throws HibernateException {
     
      Session session = sessionFactory.openSession();
        Transaction tx= session.beginTransaction();
        User user = new User();
        Contact contact=new Contact();
        contact.setEmail("email");
        contact.setAddress("address");
       
        user.setName("caterpillar");
        user.setPassword("password");
        user.setContact(contact);
       
        session.save(user);
        tx.commit();
        session.close();
        System.out.println("OK錛?);
   }
   
    public static void testQuery( SessionFactory sessionFactory )throws HibernateException {
     
     Session session = sessionFactory.openSession();
        Transaction tx= session.beginTransaction();
        User user = new User();
        Contact contact=new Contact();
                 
        Query query=session.createQuery("from User as user");
        //query.setCharacter(1, 'M');
        List names =query.list();
        for(ListIterator it=names.listIterator();it.hasNext();){
           user= (User)it.next();
           System.out.println("Id: " + user.getId());
            System.out.println("name: " + user.getName());
            System.out.println("password: " + user.getPassword());
            if(user.getContact()!=null){
             
             if(user.getContact().getEmail()!=null){
              System.out.println("Email: " + user.getContact().getEmail());
             }
             if(user.getContact().getAddress()!=null){
              System.out.println("Address: " + user.getContact().getAddress());
               
             }
            }
           
           
           
        }
         
      
        tx.commit();
        session.close();
     
    }
}

 

  

 



all gone 2005-12-10 12:50 鍙戣〃璇勮
]]>
Eclipse涓婮SF鍏ラ棬http://www.tkk7.com/felicity/archive/2005/12/10/23251.htmlall goneall goneSat, 10 Dec 2005 04:05:00 GMThttp://www.tkk7.com/felicity/archive/2005/12/10/23251.htmlhttp://www.tkk7.com/felicity/comments/23251.htmlhttp://www.tkk7.com/felicity/archive/2005/12/10/23251.html#Feedback2http://www.tkk7.com/felicity/comments/commentRss/23251.htmlhttp://www.tkk7.com/felicity/services/trackbacks/23251.html   涓嶦clipse涓婼truts鐨勫紑鍙戠被浼鹼紝瀹夎濂紼clipse鍜孴omcat涔嬪悗錛岃繕闇瑕佷袱涓彃浠訛細tomcat 鎻掍歡鍜孞SF鎻掍歡錛堝鏋滅浉鍏蟲彃浠惰繕娌℃湁瀹夎錛夛紝浠ヤ笅鏄浉鍏充笅杞藉湴鍧錛?
    Eclipse SDK錛?
        http://www.eclipse.org/downloads/index.php 
    JSF:
     https://sourceforge.jp/projects/amateras/files/  
      FaceIDE+htmlEditor錛宧tmlEditer涔熸槸蹇呰鐨?
    Tomcat :
         http://www.sysdeo.com/eclipse/tomcatplugin 
    Plugin Search:
         http://eclipse-plugins.2y.net/eclipse/search.jsp 
   鎻掍歡鐨勫畨瑁呭拰閰嶇疆鏈夐棶棰樿鐩存帴Google銆?
2.寮濮?
    鍏ラ棬鍢涳紝鎴戜滑灝辨壘涓涓渶綆鍗曠殑Login灝卞彲浠ヤ簡

    鏂板緩Tomcat project
    鍔犲叆JSF鏀寔

    鏂板緩涓涓狹anagedBean錛?


/**
 *
 */
package com.jsf;




/**
 * @author lzy
 *
 */
public class UserBean {
private String name;
    private String password;
public String verify() {
     if(this.name.equals("name")&&this.password.equals("password"))
     
        return "failure";

   else
        return "success";
}

 
/**
* @return Returns the name.
*/
public String getName() {
return name;
}

/**
* @param name The name to set.
*/
public void setName(String name) {
this.name = name;
}


/**
* @return Returns the password.
*/
public String getPassword() {
return password;
}

/**
* @param password The password to set.
*/
public void setPassword(String password) {
this.password = password;
}


}

     鏂板緩涓や釜JSP欏甸潰錛宭ogin.jsp,welcom.jsp

login.jsp
<%@ page contentType="text/html; charset=GBK" %>
<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %>
<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %>

<html>
<head>
<%@ page contentType="text/html; charset=GBK" %>
<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %>
<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %>

<html>
<head>
<link href="main.css" rel="stylesheet"/>
<title></title>

</head>
<body>
    <f:view>
    <f:loadBundle basename="com.jsf.MessageResources" var="msgs"></f:loadBundle>
   
        <h:form>
        <h:panelGrid columns="3" headerClass="header" rowClasses="evenRow,oddRow">
        <f:facet name="header" >
        <h:outputText value="#{msgs.header}"/>
        </f:facet>
       
        <h:outputText value="#{msgs.namePromt}"></h:outputText>
        <h:inputText id="name"  required="true" value="#{user.name}">
        <f:validateLength minimum="2" maximum="10"></f:validateLength>
        </h:inputText>
        <h:message for="name" errorClass="errors"/>
       
       
        <h:outputText value="#{msgs.passwordPromt}"></h:outputText>
       
        <h:inputSecret id="password" value="#{user.password}" required="true" redisplay="true">
        <f:validateLength minimum="2"></f:validateLength>
        </h:inputSecret>
        <h:message for="password"/>
       
       
              <f:facet name="footer" >
        <h:outputText value="#{msgs.footer}"/>
        </f:facet>
        </h:panelGrid>          
            <h:commandButton value="#{msgs.submitPromt}" action="#{user.verify}"/>
            <h:commandButton value="#{msgs.resetPromt}" type="reset"/>
        </h:form>
    </f:view>
</body>
</html>



welcome.jsp


<%@ page contentType="text/html; charset=GBK" %>
<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %>
<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %>

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=GBK"/>
<title></title>
</head>
<body>
    <f:view>
        <h:outputText value="#{user.name}"/>  is a good boy錛?
        <h3>welcome JavaServer Faces</h3>
    </f:view>
</body>

</html>
     緙栬緫WEB錛岻NF/lib涓嬬殑faces錛峜onfig.xml

struts-config.xml

<?xml version="1.0"?>
<!DOCTYPE faces-config PUBLIC "-//Sun Microsystems, Inc.//DTD JavaServer Faces Config 1.1//EN" "http://java.sun.com/dtd/web-facesconfig_1_1.dtd">
<faces-config>
<navigation-rule>
        <from-view-id>/login.jsp</from-view-id>
        <navigation-case>
            <from-outcome>success</from-outcome>
            <to-view-id>/welcome.jsp</to-view-id>
        </navigation-case>
        <navigation-case>
            <from-outcome>failure</from-outcome>
            <to-view-id>/login.jsp</to-view-id>
        </navigation-case>
</navigation-rule>


<managed-bean>
<managed-bean-name>user</managed-bean-name>
<managed-bean-class>com.jsf.UserBean</managed-bean-class>
<managed-bean-scope>session</managed-bean-scope>
</managed-bean>
</faces-config>


       鏈鍚庢槸璧勬簮鏂囦歡

# --login.jsp--
header=Welcom
namePromt=Name:
passwordPromt=Password:
amountPromt=Amount:
datePromt=Date:
submitPromt=Submit
resetPromt=Reset
footer=Thank you!


3.嫻嬭瘯
鍦╰est宸ョ▼涓夋嫨tomcat project錛?gt;Update context definition
鐒跺悗榪愯Tomcat
http://127.0.0.1:8080/jsfTest/login.jsf

all gone 2005-12-10 12:05 鍙戣〃璇勮
]]>
Eclipse涓婼truts寮鍙戝叆闂?/title><link>http://www.tkk7.com/felicity/archive/2005/12/10/23244.html</link><dc:creator>all gone</dc:creator><author>all gone</author><pubDate>Sat, 10 Dec 2005 03:10:00 GMT</pubDate><guid>http://www.tkk7.com/felicity/archive/2005/12/10/23244.html</guid><wfw:comment>http://www.tkk7.com/felicity/comments/23244.html</wfw:comment><comments>http://www.tkk7.com/felicity/archive/2005/12/10/23244.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.tkk7.com/felicity/comments/commentRss/23244.html</wfw:commentRss><trackback:ping>http://www.tkk7.com/felicity/services/trackbacks/23244.html</trackback:ping><description><![CDATA[<P> </P> <P>1.寮鍙戠幆澧?BR>   寮鍙戜箣鍓嶉鍏堝簲璇ュ噯澶囧ソ寮鍙戠幆澧冿紝Eclipse 3.X鏄竴涓笉閿欑殑Java IDE錛屾湁寰堝鎻掍歡鍙互渚涙垜浠夋嫨錛屾湇鍔″櫒鐢═omcat灝辮浜嗐傚畨瑁呭ソEclipse鍜孴omcat涔嬪悗錛岃繕闇瑕佷袱涓彃浠訛細tomcat 鎻掍歡鍜孲truts鎻掍歡錛屼互涓嬫槸鐩稿叧涓嬭澆鍦板潃錛?BR>     Eclipse SDK錛?BR>        <A >http://www.eclipse.org/downloads/index.php</A> <BR>    Struts: <BR>     <A >https://sourceforge.jp/projects/amateras/files/</A>         StrutsIDE+htmlEditor錛宧tmlEditer涔熸槸蹇呰鐨?BR>    Tomcat : <BR>         <A >http://www.sysdeo.com/eclipse/tomcatplugin</A> <BR>    Plugin Search: <BR>         <A >http://eclipse-plugins.2y.net/eclipse/search.jsp</A> <BR>   鎻掍歡鐨勫畨瑁呭拰閰嶇疆鏈夐棶棰樿鐩存帴Google銆?BR>2.寮濮?BR>    鍏ラ棬鍢涳紝鎴戜滑灝辨壘涓涓渶綆鍗曠殑Login灝卞彲浠ヤ簡</P> <P>    鏂板緩Tomcat project錛屽涓嬪浘</P> <P>    鍔犲叆struts鏀寔<BR>    鏂板緩涓涓狥ormBean:LoginForm</P> <P><BR>/**<BR> * <BR> */<BR>package com.test;</P> <P>import javax.servlet.http.HttpServletRequest;</P> <P>import org.apache.struts.action.ActionErrors;<BR>import org.apache.struts.action.ActionForm;<BR>import org.apache.struts.action.ActionMapping;<BR>import org.apache.struts.action.ActionMessage;</P> <P>/**<BR> * @author lzy<BR> *<BR> */<BR>public class LoginForm extends ActionForm {</P> <P> private String name=null;<BR> private String password=null;<BR> /* (non-Javadoc)<BR>  * @see org.apache.struts.action.ActionForm#reset(org.apache.struts.action.ActionMapping, javax.servlet.http.HttpServletRequest)<BR>  */<BR> @Override<BR> public void reset(ActionMapping arg0, HttpServletRequest arg1) {<BR>  // TODO Auto-generated method stub<BR>  name=null;<BR>  password=null;<BR> }<BR> /* (non-Javadoc)<BR>  * @see org.apache.struts.action.ActionForm#validate(org.apache.struts.action.ActionMapping, javax.servlet.http.HttpServletRequest)<BR>  */<BR> @Override<BR> public ActionErrors validate(ActionMapping arg0, HttpServletRequest arg1) {<BR>  // TODO Auto-generated method stub<BR>ActionErrors errors=new ActionErrors();<BR>  <BR>  if(name==null||name.length()<1){<BR>   errors.add("username",new ActionMessage("errors.login.name.empty"));<BR>   <BR>  }<BR>  if(password==null||password.length()<1){<BR>   errors.add("password",new ActionMessage("errors.login.password.empty"));<BR>   <BR>  }<BR>  <BR>  return errors;<BR> }<BR> /**<BR>  * @return Returns the name.<BR>  */<BR> public String getName() {<BR>  return name;<BR> }<BR> /**<BR>  * @param name The name to set.<BR>  */<BR> public void setName(String name) {<BR>  this.name = name;<BR> }<BR> /**<BR>  * @return Returns the password.<BR>  */<BR> public String getPassword() {<BR>  return password;<BR> }<BR> /**<BR>  * @param password The password to set.<BR>  */<BR> public void setPassword(String password) {<BR>  this.password = password;<BR> }<BR>}</P> <P> </P> <P> </P> <P>     鏂板緩涓涓狝ction:LoginAction</P> <P>/**<BR> * <BR> */<BR>package com.test;</P> <P><BR>import javax.servlet.http.HttpServletRequest;<BR>import javax.servlet.http.HttpServletResponse;<BR>import javax.servlet.http.HttpSession;<BR>import org.apache.struts.*;<BR>import org.apache.struts.action.Action;<BR>import org.apache.struts.action.ActionForm;<BR>import org.apache.struts.action.ActionForward;<BR>import org.apache.struts.action.ActionMapping;<BR>import org.apache.struts.action.ActionMessage;<BR>import org.apache.struts.action.ActionMessages;</P> <P>/**<BR> * @author lzy<BR> *<BR> */<BR>public class LoginAction extends Action {<BR> public ActionForward execute(ActionMapping mapping, ActionForm actionForm, HttpServletRequest request, HttpServletResponse response) throws Exception {<BR>  // TODO Auto-generated method stub<BR>  LoginForm loginForm=(LoginForm)actionForm;<BR>  String name=loginForm.getName();<BR>  String password=loginForm.getPassword();</P> <P><BR> if(name.equals("name")&&password.equals("password")){<BR>   HttpSession session=request.getSession(true);<BR>   session.setAttribute("LOGGED_USER",name);</P> <P>   <BR>   return mapping.findForward("success");<BR>   <BR>  }<BR>  else{<BR>   ActionMessages errors=new ActionMessages();<BR>   errors.add("login.failure",new ActionMessage("errors.login.failure")); <BR>   this.saveErrors(request,errors);<BR>   <BR>   return mapping.findForward("failure"); <BR>   <BR>  }<BR>  <BR> }</P> <P>}</P> <P>     鏂板緩涓や釜JSP欏甸潰錛宭ogin.jsp,index.jsp</P> <P>login.jsp<BR><%@ page contentType="text/html; charset=GBK" %><BR><%@ taglib uri="/tags/struts-html" prefix="html" %><BR><%@ taglib uri="/tags/struts-tiles" prefix="tiles" %></P> <P><html:html><BR> <head><BR>  <html:base /><BR>          </head><BR> <body><BR> <center><BR> <html:errors /><BR>  <html:form action="/login.do" method="POST"><BR>  <table border="1"><BR>   <tr><BR>    <td colspan="2"><bean:message key="login.jsp.form.title"/></td><BR>   </tr><BR>   <tr><BR>    <td align="right"><bean:message key="login.jsp.name"/></td><BR>    <td><html:text property="name" size="20"></html:text></td><BR>   </tr><BR>   <tr><BR>    <td align="right"><bean:message key="login.jsp.password"/></td><BR>    <td><html:password property="password" size="20"></html:password></td><BR>   </tr><BR>   <tr><BR>    <td colspan="2"><BR>     <html:submit><bean:message key="form.submit"/></html:submit><BR>     <html:reset><bean:message key="form.reset"/></html:reset><BR>    </td><BR>   </tr><BR> <BR>  </table><BR> <BR>  </html:form><BR>  <BR> </center><BR> </body><BR></html:html></P> <P><BR>index.jsp</P> <P><BR><%@ page contentType="text/html; charset=GBK" %><BR><%@ taglib uri="/tags/struts-bean" prefix="bean" %><BR><%@ taglib uri="/tags/struts-logic" prefix="logic" %><BR><%@ taglib uri="/tags/struts-html" prefix="html" %><BR><%@ taglib uri="/tags/struts-nested" prefix="nested" %></P> <P><html:html><BR> <head><BR>  <meta http-equiv="Content-Type" content="text/html; charset=GBK"/><BR>  <title></title><BR> </head><BR> <body><BR> hello<BR>  <logic:present name="LOGGED_USER">,<bean:write name="LOGGED_USER"/><BR>  </logic:present><BR> </body><BR></html:html></P> <P><BR>     緙栬緫WEB錛岻NF/lib涓嬬殑struts錛峜onfig.xml</P> <P>struts-config.xml</P> <P><?xml version="1.0"?><BR><!DOCTYPE struts-config PUBLIC "-//Apache Software Foundation//DTD Struts Configuration 1.2//EN" "<A ><BR><struts-config><BR>  <data-sources><BR>  </data-sources><BR>  <form-beans><BR>    <form-bean name="loginForm" type="com.lzy.LoginForm"/><BR>  </form-beans><BR>  <global-exceptions><BR>  </global-exceptions><BR>  <global-forwards><BR>  </global-forwards><BR>  <action-mappings><BR>      <action path="/login" name="loginForm" type="com.lzy.LoginAction" scope="session" validate="true" input="/login.jsp"><BR>      <forward name="failure" path="/login.jsp"/><BR>      <forward name="success" path="/index.jsp"/><BR>    </action><BR>  </action-mappings><BR>  <controller processorClass="org.apache.struts.tiles.TilesRequestProcessor"/><BR>  <message-resources parameter="MessageResources"/></P> <P></struts-config></P> <P><BR>       鏈鍚庢槸璧勬簮鏂囦歡</P> <P># -- standard errors --<BR>errors.header=<UL><font color="red"><h2>Errors:</h2><BR>errors.prefix=<LI><BR>errors.suffix=</LI><BR>errors.footer=</font></UL><hr></P> <P><BR>form.submit=Submit</P> <P>form.reset=Reset</P> <P><BR># -- login.jsp --<BR>login.jsp.title=Login<BR>login.jsp.form.title=Login<BR>login.jsp.name=Name:<BR>login.jsp.password=Password:</P> <P># -- login errors --<BR>errors.login.name.empty=The name can not be empty!<BR>errors.login.password.empty=The password can not be empty!<BR>errors.login.failure=Login failed!<br> Please check your username and password!</P> <P> </P> <P>3.嫻嬭瘯<BR>鍦╰est宸ョ▼涓夋嫨tomcat project錛?gt;Update context definition<BR>鐒跺悗榪愯Tomcat<BR><A >http://127.0.0.1:8080/test/login.jsp</A></P> <P><BR>   </P><img src ="http://www.tkk7.com/felicity/aggbug/23244.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.tkk7.com/felicity/" target="_blank">all gone</a> 2005-12-10 11:10 <a href="http://www.tkk7.com/felicity/archive/2005/12/10/23244.html#Feedback" target="_blank" style="text-decoration:none;">鍙戣〃璇勮</a></div>]]></description></item><item><title>Java Web Service 涔婼OAP鍏ラ棬 http://www.tkk7.com/felicity/archive/2005/12/09/23204.htmlall goneall goneFri, 09 Dec 2005 11:39:00 GMThttp://www.tkk7.com/felicity/archive/2005/12/09/23204.htmlhttp://www.tkk7.com/felicity/comments/23204.htmlhttp://www.tkk7.com/felicity/archive/2005/12/09/23204.html#Feedback0http://www.tkk7.com/felicity/comments/commentRss/23204.htmlhttp://www.tkk7.com/felicity/services/trackbacks/23204.html       緙栫▼鐨勪漢鎬繪湁榪欎箞涓涓埍濂斤紝寮濮嬬殑鏃跺欐昏鎷夸竴涓狧elloWorld浼肩殑渚嬪瓙璇曡瘯錛屾垜涔熶笉渚嬪銆?瑕佽瘯褰撶劧瑕佹湁SOAP鐨勮繍琛岀幆澧冦傛寜鐓т功涓婄殑鎸囩ず錛岃濂戒簡Tomcat錛屼笅杞戒簡鐩稿叧鐨勫寘錛屽皢soap.jar ,mail.jar,activatio.jar,xercesImpl.jar 鍔犲叆鍒頒簡鐜鍙橀噺classpath涓紝灝唖oap.war鎷瘋礉鍒頒簡TOMCAT鐨剋ebapps鐩綍涓嬨?BR>       榪愯SOAP鐨勬祴璇曠洰褰曪細HTTP://127.0.0.1:8080/soap/鍙戠幇soap宸茬粡姝e父宸ヤ綔銆?鎺ョ潃渚挎槸閮ㄧ講鏂扮殑SOAP鏈嶅姟浜嗭紝鎸夌収涔︿笂鐨勬簮鐮侊紝鍐欏ソ浜嗘祴璇曠敤鐨勯儴緗茬被鍜屽鎴風綾伙紝緙栬瘧閫氳繃銆傚湪閮ㄧ講鏂扮殑SOAP鐨剋eb欏甸潰涓嬫寜鐓т功涓婄殑姝ラ娣誨ソ琛ㄥ崟騫墮儴緗插畬鎴愩傚皢嫻嬭瘯鎵鍦ㄧ洰褰曟坊鍔犲埌classpath涓?閲嶅惎tomcat銆?榪愯鍒氭墠緙栬瘧濂界殑瀹㈡埛绔被錛岀粨鏋淣oClassDefError銆?BR>       璇曚簡濂藉嚑閬嶏紝閮芥槸榪欐牱錛屽緢鏄鎴戦儊闂峰晩銆?鐪嬩簡鍙︿竴鏈功銆妀ava web鏈嶅姟搴旂敤寮鍙戣瑙c嬬粓浜庢壘鍒頒簡絳旀錛?榪愯瀹㈡埛绔祴璇曠▼搴忔椂錛?**Client.class鏄湪Package test涓殑 榪愯鏃墮鍥炲埌test鐨勪笂綰х洰褰曪紝java test.***Client 鍗沖彲銆?鎴戞兂閬囧埌綾諱技闂錛岃繕鏄java鐨勫寘涓嶇啛鎮夈?

all gone 2005-12-09 19:39 鍙戣〃璇勮
]]>
Eclipse 浣跨敤灝忕粨 http://www.tkk7.com/felicity/archive/2005/12/09/23203.htmlall goneall goneFri, 09 Dec 2005 11:38:00 GMThttp://www.tkk7.com/felicity/archive/2005/12/09/23203.htmlhttp://www.tkk7.com/felicity/comments/23203.htmlhttp://www.tkk7.com/felicity/archive/2005/12/09/23203.html#Feedback0http://www.tkk7.com/felicity/comments/commentRss/23203.htmlhttp://www.tkk7.com/felicity/services/trackbacks/23203.html         Eclipse 鏄竴涓熀浜庢彃浠剁殑寮鍙戝鉤鍙幫紝寰堝鍔熻兘閮芥槸閫氳繃鎻掍歡鏉ュ畬鎴愮殑銆傛瘮濡傝瑕佸仛Java鍥懼艦鐣岄潰寮鍙戯紝濡備嬌鐢ˋWT鍜孲WING鐨勫紑鍙戯紝灝遍渶瑕佷笅杞界浉搴旂殑鎻掍歡錛屽洜姝や嬌鐢‥clipse鏃墮櫎浜嗗熀鏈殑Eclipse SDK榪橀渶瑕佷笅杞藉畨瑁呯浉搴旂殑鎻掍歡銆?
涓嬮潰鏄竴浜涚浉鍏崇殑涓嬭澆鍦板潃錛?BR>    Eclipse SDK錛?BR>          http://www.eclipse.org/downloads/index.php錛坴3.1.1錛?nbsp; 
  
    SWING+AWT: 
         Visual Editor: http://www.eclipse.org/vep/ (v1.1.0.1 released) 

    Struts: 
         StrutsIDE+htmlEditor: https://sourceforge.jp/projects/amateras/files/( v1.1.7+1.6.7) 
   J2EE: 
         Tomcat : http://www.sysdeo.com/eclipse/tomcatplugin 
         Lomboz: http://forge.objectweb.org/project/showfiles.php?group_id=97 

   JSF:
       faceIDE https://sourceforge.jp/projects/amateras/files/( v1.1.7+1.6.7) 

   Hibernate: 
         Hibernate synchronizer http://hibernatesynch.sourceforge.net

 Plugin Search: 
         http://eclipse-plugins.2y.net/eclipse/search.jsp

all gone 2005-12-09 19:38 鍙戣〃璇勮
]]>
JBuilder 寮鍙慗2ME紼嬪簭絎竴姝?http://www.tkk7.com/felicity/archive/2005/12/09/23202.htmlall goneall goneFri, 09 Dec 2005 11:33:00 GMThttp://www.tkk7.com/felicity/archive/2005/12/09/23202.htmlhttp://www.tkk7.com/felicity/comments/23202.htmlhttp://www.tkk7.com/felicity/archive/2005/12/09/23202.html#Feedback0http://www.tkk7.com/felicity/comments/commentRss/23202.htmlhttp://www.tkk7.com/felicity/services/trackbacks/23202.htmlConfigure JDKs 涔嬪悗錛屾柊寤哄伐紼嬶紝閫夋嫨鍒氭墠鐨刯dk銆? 鎵撳紑Project->Project Properties,鍦╮un 閫夐」鍗′腑鐐筃ew 鍦ㄥ脊鍑烘涓夋嫨run, type鏀逛負MIDlet(鍘熸潵涓篈pplication)銆? 涔嬪悗灝卞彲浠ユ柊寤篗IDlet浜嗐?

all gone 2005-12-09 19:33 鍙戣〃璇勮
]]>
JSP瀹炵幇鐣欒█鏉跨殑JavaBean綾誨拰鍒嗛〉鏄劇ず鐨勬簮鐮?http://www.tkk7.com/felicity/archive/2005/12/09/23199.htmlall goneall goneFri, 09 Dec 2005 11:30:00 GMThttp://www.tkk7.com/felicity/archive/2005/12/09/23199.htmlhttp://www.tkk7.com/felicity/comments/23199.htmlhttp://www.tkk7.com/felicity/archive/2005/12/09/23199.html#Feedback0http://www.tkk7.com/felicity/comments/commentRss/23199.htmlhttp://www.tkk7.com/felicity/services/trackbacks/23199.html 

//鐣欒█bean
package userinfobean;

/**
 * <p>Title: </p>
 * <p>Description: </p>
 * <p>Copyright: Copyright (c) 2004</p>
 * <p>Company: </p>
 * @author not attributable
 * @version 1.0
 */

public class memoBean {

  private String id;//1.鐢ㄦ埛鍚?BR>  private String email;//2.瀵嗙爜
  private String content;//3.鐣欒█ 

  public memoBean() {
  }
  //1.鐢ㄦ埛鍚?BR>  public void setId(String s){
    this.id=s;
  }
  //2.瀵嗙爜
  public void setEmail(String s){
    this.email=s;
  }
  //3.鐣欒█
   public void setContent(String s){
    this.content=s;
  }
 

  //1.鐢ㄦ埛鍚?BR>   public String getId( ){
     return this.id;
   }
   //2.瀵嗙爜
   public String getEmail(){
     return this.email;
   }
   //3.鐣欒█ 
   public String getContent(){
     return this.content;
   }
}
//// 鐢ㄤ簬鏁版嵁搴撴搷浣滅殑bean          
package userinfobean;

import userinfobean.*;
import java.io.*;
import java.util.*;
import java.sql.*;


public class databaseBean{
  private String dbName;
  private String dbUser;
  private String dbPass;
   private Vector memoVector;

   Connection connection;

  public databaseBean(){
    dbName=new String("脳脳脳脳脳脳脳");
    dbUser=new String("脳脳脳脳脳脳");
    dbPass=new String("脳脳脳脳脳脳脳");
    String connectionUrl="jdbc:mysql://localhost/"+dbName;
    try{
      Class.forName("org.gjt.mm.mysql.Driver");
      connection=DriverManager.getConnection(connectionUrl,dbUser,dbPass);
    }
    catch(Exception e){
      System.out.println(e.toString());
      }
  }

  public void dbQueryMemos(){
    try{
       memoVector=new Vector();
      Statement stmt=connection.createStatement();
      ResultSet rs=stmt.executeQuery("select * from memo;");
      while(rs.next()){
        memoBean temp=new memoBean();
        temp.setId(rs.getString(2));
        temp.setEmail(rs.getString(3));
        temp.setContent(rs.getString(4));
        memoVector.add(temp);
      }

   }
   catch(SQLException e){
     System.out.println(e.toString());
   }

 

  }

    public void setDbName(String s){
    this.dbName=s;
  }
  public void setDbUser(String s){
    this.dbUser=s;
  }
  public void setDbPass(String s){
    this.dbPass=s;
  }

  public String getDbName(){
    return this.dbName;
  }
  public String getDbUser(){
    return this.dbUser;
  }
  public String getDbPass(){
    return this.dbPass;
  }
    public Vector getMemoVector(){
    return this.memoVector;

  }

}

///浠ヤ笅鏄綉欏墊簮鐮?BR>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<%@ page language="java" import="java.util.*" %>
<%@ page  import="java.text.*" %>
<%@ page  import="userinfobean.*" %>
<jsp:useBean id="memoInfo" scope="page" class="userinfobean.memoBean"/>
<jsp:useBean id="memoQuery" scope="page" class="userinfobean.databaseBean"/>
<%!
int totalPages;
int countPerPage=3;
int totalCount;
int currentPage=0;
int currentStart;
%>
<%
memoQuery.dbQueryMemos();
Vector vt=memoQuery.getMemoVector();
totalCount=vt.size();
totalPages=totalCount/countPerPage;
if(totalCount%countPerPage>0)totalPages=totalPages+1;
if(request.getParameter("page")==null)
{
currentPage=1;
}
else
{
currentPage=Integer.parseInt(request.getParameter("page"));
if(currentPage>totalPages)currentPage=totalPages;
if(currentPage<1)currentPage=1;
}
currentStart=totalCount-1-countPerPage * (currentPage-1);
%>
<html>
<head>
<title>NetGreen</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
  <link rel="stylesheet" href="main.css">                            
</head>
<script language="JavaScript" >
function page_check()
{
if(document.pageForm.page.value=="")
{alert("璇瘋緭鍏ラ〉鏁?);
document.pageForm.page.focus();
return false;
}
return true;
}</script>
<body bgcolor="ffffff"  >

<center>
  <table width="800" border="0" height="622">
    <tr>
      <td height="71" align="center" valign="middle"> <table width="100%" border="1" cellpadding="0" cellspacing="0" bordercolor="#0099CC">
          <tr>
            <td width="19%" height="60" align="left" valign="bottom" bgcolor="#FFFFFF"><b><font size="4" color="#00cc66" ><img src="image/logo.gif" width="156" height="60"></font></b></td>
            <td width="57%" align="left" valign="bottom" bgcolor="#FFFFFF"><img src="image/banner.gif" width="100%" height="60"></td>
            <td width="24%" align="left" valign="bottom"> <table width="102%" height="60" border="1" cellpadding="0" cellspacing="0" bordercolor="#0099CC" bgcolor="#FFFFFF">
                <tr>
                  <td width="50%" height="27" align="center">涓?浼?lt;/td>
                  <td width="50%" align="center">鏀惰棌鏈〉</td>
                </tr>
                <tr>
                  <td height="21" align="center" bgcolor="#FFFFFF" >閫 鍑?</td>
                  <td align="center"><a href="memoForm.htm" target="_self">鎴戣鐣欒█</a></td>
                </tr>
              </table></td>
          </tr>
        </table></td>
    </tr>
    <tr>
      <td height="31"><table width="100%" border="1" bordercolor="#0099CC">
          <tr bgcolor="#00CC66">
            <td width="12%" height="23" align="center" bgcolor="#CCFFFF"><a href="index.htm" >棣栭〉</a></td>
            <td width="12%" align="center" bgcolor="#CCFFFF"><a href="loginForm.htm" >鐧婚檰</a></td>
            <td width="12%" align="center" bgcolor="#CCFFFF">&nbsp;</td>
            <td width="12%" align="center" bgcolor="#CCFFFF">&nbsp;</td>
            <td width="12%" align="center" bgcolor="#CCFFFF" >&nbsp; </td>
            <td width="12%" align="center" bgcolor="#CCFFFF">&nbsp;</td>
            <td width="12%" align="center" bgcolor="#CCFFFF"><a href="memoDisplay.jsp" >鐣欒█鏉?lt;/a></td>
            <td width="12%" align="center"  bgcolor="#CCFFFF"><a href="registForm.htm">娉ㄥ唽</a></td>
          </tr>
        </table></td>
    </tr>
    <tr>
      <td height="435" align="center" valign="top" nowrap>
        <table width="100%"  border="1" cellpadding="0" cellspacing="0" bordercolor="#0099CC">
          <tr>
            <td width="18%" height="431" align="center" valign="middle" bgcolor="#CCFFFF">
            </td>
            <td width="83%" align="center" valign="top" bgcolor="#FFFFFF"><table width="100%" border="1"><form name="pageForm" method="post"  onSubmit="return page_check();"action="memoDisplay.jsp">
                <tr>
                  <td width="36%">鍏辨湁鐣欒█<%out.print(totalPages);%> 欏碉紝鐜板湪鏄<%out.print(currentPage);%>  欏?lt;/td>
                    <td width="64%">
     <a href="memoDisplay.jsp?page=<%=currentPage-1%>" >涓婁竴欏?</a>
     <a href="memoDisplay.jsp?page=<%=currentPage+1%>" >涓嬩竴欏?nbsp; </a>
     <a href="memoDisplay.jsp?page=1" >棣栭〉 </a>
      <a href="memoDisplay.jsp?page=<%=totalPages%>" >灝鵑〉  </a>
      <input type="submit" name="Submit" value="G0">
                      <input name="page" type="text" size="10">
                      欏?lt;/td>
                </tr>
              </form></table>
              <%
    
    for(int i=0;i<countPerPage&&currentStart-i>=0;i++)
    {
     memoInfo.setId(((memoBean)vt.get(currentStart-i)).getId());
     memoInfo.setEmail(((memoBean)vt.get(currentStart-i)).getEmail());
     memoInfo.setContent(((memoBean)vt.get(currentStart-i)).getContent());
     
     
     
   out.print("<table width='100%' border='1' ><tr><td width='19%'>");
   out.print(memoInfo.getId());
   out.print("</td><td width='81%'>");
   out.print(memoInfo.getEmail());
   out.print("</td></tr><tr><td height='44' colspan='2'>");
   out.print(memoInfo.getContent());
   out.print("</td></tr></table> ");
   out.print("<br>");
     
    }
  
   %>
   </td>
          </tr>
        </table>
      </td>
    </tr>
    <tr>
      <td height="73" align="center" valign="top" nowrap>
        <table width="100%" border="0">
          <tr>
            <td height="21" align="center" bgcolor="#FFFFFF"><hr width="85%" noshade  color="#00CC66"></td>
          </tr>
          <tr>
            <td height="12" align="center">Copyright @ HomeLee. All rights reserved.
            </td>
          </tr>
          <tr>
            <td height="12" align="center" bgcolor="#FFFFFF">&nbsp;</td>
          </tr>
        </table></td>
    </tr>
  </table>
  </center></body>
</html>



all gone 2005-12-09 19:30 鍙戣〃璇勮
]]>
JDBC榪炴帴MySQL鏁版嵁搴?http://www.tkk7.com/felicity/archive/2005/12/09/23198.htmlall goneall goneFri, 09 Dec 2005 11:29:00 GMThttp://www.tkk7.com/felicity/archive/2005/12/09/23198.htmlhttp://www.tkk7.com/felicity/comments/23198.htmlhttp://www.tkk7.com/felicity/archive/2005/12/09/23198.html#Feedback0http://www.tkk7.com/felicity/comments/commentRss/23198.htmlhttp://www.tkk7.com/felicity/services/trackbacks/23198.html      鏌ユ壘椹卞姩紼嬪簭 MySQL鐩墠鎻愪緵鐨刯ava椹卞姩紼嬪簭涓篊onnection/J錛屽彲浠ヤ粠MySQL瀹樻柟緗戠珯涓嬭澆錛屽茍鎵懼埌mysql-connector-java-3.0.15-ga-bin.jar鏂囦歡錛屾椹卞姩紼嬪簭涓虹函java椹卞姩紼嬪簭錛屼笉闇鍋氬叾浠栭厤緗?
Step2錛?BR>      鍔ㄦ佹寚瀹歝lasspath 濡傛灉闇瑕佹墽琛屾椂鍔ㄦ佹寚瀹歝lasspath錛屽氨鍦ㄦ墽琛屾椂閲囩敤錛峜p鏂瑰紡銆傚惁鍒欏皢涓婇潰鐨?jar鏂囦歡鍔犲叆鍒癱lasspath鐜鍙橀噺涓?BR> Step3錛?BR>      鍔犺澆椹卞姩紼嬪簭
       try{ 
               Class.forName("com.mysql.jdbc.Driver"); 
                System.out.println("Success loading Mysql Driver!"); 
       } 
      catch(Exception e) { 
               System.out.println("Error loading Mysql Driver!");
                e.printStackTrace(); 
        }
Step4錛?BR>        璁劇疆榪炴帴鐨剈rl jdbc錛歮ysql錛?/localhost/databasename[?pa=va][&pa=va]

all gone 2005-12-09 19:29 鍙戣〃璇勮
]]>
主站蜘蛛池模板: 337p日本欧洲亚洲大胆人人| 日本中文一区二区三区亚洲| 亚洲免费在线观看视频| 一级毛片aaaaaa免费看| 亚洲专区在线视频| 99久久人妻精品免费一区| 亚洲成a人片77777老司机| 香港a毛片免费观看 | 欧洲亚洲国产精华液| 黄网址在线永久免费观看 | 黄瓜视频高清在线看免费下载| 亚洲五月综合缴情婷婷| 丁香花免费高清视频完整版| 亚洲色丰满少妇高潮18p| 免费无码黄动漫在线观看| 无码天堂亚洲国产AV| 亚洲国产精品无码久久青草 | 在线观看视频免费完整版| 亚洲中文字幕无码久久2020| 免费看的黄色大片| 美女视频黄视大全视频免费的| 四虎永久成人免费| 免费无码一区二区| 亚洲香蕉网久久综合影视| 久久久久久久99精品免费观看| 亚洲日本一区二区三区| 国产精品免费观看| 亚洲精品又粗又大又爽A片| 国产伦一区二区三区免费 | 久久久久久久综合日本亚洲| 亚洲免费视频在线观看| 亚洲国产精品线观看不卡| 成人黄软件网18免费下载成人黄18免费视频 | 一级毛片无遮挡免费全部| 国产日产亚洲系列| 日韩免费无码视频一区二区三区| 亚洲第一成年人网站| 成人免费无遮挡无码黄漫视频| 美女扒开尿口给男人爽免费视频| 国产av无码专区亚洲国产精品| 免费观看在线禁片|