proxoolÔÚjspÖеÄÓ¦ÓÃ
ÏÈÌù¸ö½éÉÜ
http://i.cn.yahoo.com/suzie0228/blog/p_41/
proxoolÊÇÒ»¸ö¿ªÔ´µÄÁ¬½Ó³Ø£¬ÐÔÄÜÓÅÒ죬×îºÃµÄÊÇ£º¼´Ê±¼à¿ØÁ¬½Ó³Ø״̬
ÏÂÃæ¼òµ¥ËµËµËüµÄʹÓ÷½·¨£º1¡¢Ê×ÏÈÏÂÔØproxool µØÖ·£ºhttp://proxool.sourceforge.net
2¡¢½âѹËõproxool-0.9.0RC3.zip£¬¿½±´libϵÄËùÓÐjar¿âÎļþµ½ÄãµÄ¹¤³ÌϵÄWEB-INF/libÏ£¬Í¬Ê±¼ÇµÃÒ²°ÑMysqlµÄjdbcÇý¶¯µ½web-info/lib
3¡¢ÔÚWEB-INFÏ£¨±ðÅÜ´íµØ·½£©½¨Á¢Îļþ£ºproxool.xml
proxool.xmlÕâ¸öÎļþÊÇÓÃÀ´ÉèÖñðÃûµÄ¡£
ÆäÖÐ<proxool>±êÇ©¾ÍÊDZðÃûµÄÉèÖöΡ£
aliasÊDZðÃû£»
driver-urlÊÇÇý¶¯µÄurl£¬¾ÍÊÇÁ¬½ÓµÄurl£»
driver-classÊÇÇý¶¯µÄÀ࣬¾ÍÊÇÊý¾Ý¿âÇý¶¯£»
driver-propertiesÊÇÇý¶¯µÄÊôÐÔ£¬¿ÉÒÔÉèÖõǽÊý¾Ý¿âµÄÓû§ÃûºÍÃÜÂë¡£maximum-connection-countÊÇ×î´óÁ¬½ÓÊý¡£
´úÂë
ÎļþÄÚÈÝÈçÏ£º
<?xml version="1.0" encoding="UTF-8"?>
<proxool>
<alias>DBPool</alias> <!--ÕâÀïÊÇÁ¬½Ó³ØµÄ±ðÃû-->
<driver-url>jdbc:mysql://localhost:3306/databaseName</driver-url>
<driver-class>org.gjt.mm.mysql.Driver</driver-class>
<driver-properties>
<property name="user" value="root"/>
<property name="password" value="12345"/>
</driver-properties>
<maximum-connection-count>500</maximum-connection-count>
<house-keeping-test-sql>select CURRENT_DATE</house-keeping-test-sql>
</proxool>
4¡¢ÔÚWEB-INF/web.xmlÖÐ<web-app>½ÚµãÀï¼ÓÈëÈçÏÂÄÚÈÝ£º
<servlet>
<servlet-name>proxoolServletConfigurator</servlet-name>
<servlet-class>org.logicalcobwebs.proxool.configuration.ServletConfigurator</servlet-class>
<init-param>
<param-name>xmlFile</param-name>
&
Ïà¹ØÎĵµ£º
1¡¢jspÒ³ÃæÂÒÂ룺
ÔÚjspÒ³Ã濪ʼÌí¼Ó<%pageEncoding="uft-8"%>
2¡¢servletÊä³öÂÒÂ룺
ÔÚÊä³öÄÚÈÝ֮ǰ£¬ÏÈÖ´ÐÐresponse.setContentType
("text/html;charset=utf-8")
3¡¢ÔÚformÀïÓÃpost·½Ê½Ìá½»²ÎÊý£º
1£©½ÓÊÕʱ¼Órequest.setCharacterEncoding("utf-8")
2£©Ê¹ÓùýÂËÆ÷£¬ÔÚ½ÓÊÕ²ÎÊý֮ǰ£¬É趨´«µÝµÄ²ÎÊýÄ ......
Ê×ÏÈÊÇÌá½»Ò³Ã棺Èý¸ö±íµ¥(form1,form2,form3)
<form name="form1" method="post" action="checklogin.jsp" class="niceform">
<input name="qx" type="hidden" value="3">
&nb ......
************************************************************************
·ÖÒ³µÄ´úÂ룺
--------------CSSÑùʽ--------------
<style type="text/css">
body,td,th {
font-family: Arial, Helvetica, sans-serif;
font-size: 12px;
color: #333;
}
body {
margin-left: 0px;
margin-top: 0px;
......
ÎÒÃÇÔÚдһ¸öjspÒ³Ã棬ҪʹÓÃstruts2±êÇ©£¬ÎÒÃÇÒªÊ×ÏÈÒªÔÚjspÒ³ÃæÍ·²¿·Å£º<%@ taglib prefix="s" uri="/struts-tags" %>£¬µ±È»Òª·Åstruts2µÄjar°üÁË¡£ÎÒÃÇ¿ÉÒÔË¢ÐÂһϴËÒ³Ã棬±ÈÈç°ÑÕâ¸öÒ³Ãæ±£´æºóÔÙ´ò¿ª£¬Ä¿µÄÊÇÔÚдstruts2±êǩʱ£¬ÓÐstruts2±êÇ©×Ô¶¯Ìáʾ¹¦ÄÜ¡£
......
JSPµÄÔËÐÐÄÚÄ»
¾³£ÓÐÅóÓÑÎÊÆð£¬JSPºÍServletÖ®¼äÓÐʲôÇø±ð£¬Á½ÕßÖ®¼äÓÖÓÐʲôÁªÏµ£¿ÆäʵServlet¼¼ÊõµÄ³öÏÖʱ¼äºÜÔ磬Êǵ±Ê±ÎªÁËJavaµÄ·þÎñÆ÷¶ËÓ¦Óöø¿ª·¢µÄ¡£´ó¼Ò¶¼ÖªµÀAppletÊÇÓ¦ÓÃС³ÌÐò£¬Servlet¾ÍÊÇ·þÎñÆ÷¶ËС³ÌÐòÁË¡£µ«ÔÚMicrosoft¹«Ë¾µÄASP¼¼Êõ³öÏÖºó£¬Ê¹Óà Servlet½øÐÐÏìÓ¦Êä³öʱһÐÐÐеÄÊä³öÓï¾ä¾ÍÏԵ÷dz£±¿×¾£ ......