1.将三个Struts包放到 C:/tomcat4127/common/lib下 [我的tomcat安装目录]
commons-dbcp-1.2.1.jar
http://apache.linuxforum.net/dist/jakarta/commons/dbcp/binaries/
struts-legacy.jar
http://apache.linuxforum.net/dist/jakarta/struts/struts-legacy/
commons-pool-1.2.jar
http://apache.linuxforum.net/dist/jakarta/commons/pool/binaries/
2.将mysql连接包 mm.mysql-2.0.4-bin.jar 放到 C:/tomcat4127/common/lib 下
3.struts配置文件中的配置
<!DOCTYPE struts-config PUBLIC
"-//Apache Software Foundation//DTD Struts Configuration 1.1//EN"
"http://jakarta.apache.org/struts/dtds/struts-config_1_1.dtd" >
.....(省略).....
<data-sources>
<data-source type="org.apache.commons.dbcp.BasicDataSource">
<set-property property="driverClassName" value="org.gjt.mm.mysql.Driver" />
<set-property property="url" value="jdbc:mysql://localhost:3306/databasename" />
<set-property property="maxCount" value="5"/>
<set-property property="minCount" value="1"/>
<set-property property="username" value="username"/>
<set-property property="password" value="your password"/>
</data-source>
</data-sources>
上面背景色不一样的地方是我设置错误的地方,呵呵,害我在网上找了半天原因。