Ò׽ؽØÍ¼Èí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

JSPÖÐÀûÓÃÊý¾ÝÔ´¶ÔÏó½¨Á¢Êý¾Ý¿âÁ¬½Ó

ÅäÖóÌÐòµÄÔËÐÐĿ¼ÓëJDBCÊý¾ÝÔ´:
<Context path="/test" docBase="F:\JSPLesson\test" reloadable="true">
    <Resource name="jdbc/bookstore" auth="Container" type="javax.sql.DataSource"
              maxActive="100" maxIdle="30" maxWait="10000"
              username="root" password="123456"
              driverClassName="com.mysql.jdbc.Driver"
              url="jdbc:mysql://localhost:3306/bookstore?autoReconnect=true"/>
</Context>
JSPÖÐͨ¹ýÈçÏ·½Ê½µÃµ½Êý¾Ý¿âÁ¬½Ó:
<%
Context ctx = new InitialContext();
DataSource ds = (DataSource)ctx.lookup("java:comp/env/jdbc/bookstore");
Connection conn = ds.getConnection();
%>


Ïà¹ØÎĵµ£º

AJAX+jspÎÞË¢ÐÂÑéÖ¤ÂëʵÀý

[list=1]
ÎÒÃÇÔÚ×öÑéÖ¤ÂëµÄʱºòÍùÍùÓÉÓÚÒª·´×÷±×£¬ÑéÖ¤ÓÐʱ¹ÊÒâ¼ÓÈë¶àµÄ¸ÉÈÅÒòËØ£¬ÕâʱÑéÖ¤ÂëÏÔʾ²»ºÜÇå³þ£¬Óû§¾­³£ÊäÈë´íÎó¡£ÕâÑù²»µ«ÒªÖØÐÂË¢ÐÂÒ³Ãæ£¬µ¼ÖÂÓû§Ã»Óп´Çå³þÑéÖ¤Âë¶øÖØÌî¶ø²»ÊÇÐ޸쬶øÇÒÈç¹ûûÓÐÓÃsession±£´æÏÂÓû§ÊäÈëµÄÆäËüÊý¾ÝµÄ»°(ÈçÐÕÃû)£¬Óû§¸Õ¸ÕÊäÈëµÄÄÚÈÝÒ²²»´æÔÚÁË£¬ÕâÑù¸øÓû§Ôì³É²»ºÃµÄÌåÑé ......

JSPÖеÄÖÐÎÄ×Ö·û´¦Àí

ÔÚ±àдJSP³ÌÐòʱ£¬³£³£»áÅöµ½ÖÐÎÄ×Ö·û´¦ÀíµÄÎÊÌ⣬ÔÚ½ÓÊÜrequestµÄÖÐÎÄ×Ö·ûʱÏÔʾ³öÀ´Ò»´®ÂÒÂë¡£ÍøÉÏ´¦Àí·½·¨Ò»Âá¿ð£¬ÏÂÃæËµËµÎÒÓùýµÄÁ½ÖÖÓÐЧµØ½â¾ö°ì·¨£º
1.Ϊ³ÌÐò±àдһ¸ö×Ö·û´®´¦Àíº¯Êý£¬ÓÃÒ»¸ö¾²Ì¬Îļþ±£´æ£¬ÔÚÐèÒª´¦ÀíÖÐÎÄ×Ö·ûµÄJSPÒ³ÃæÖаüº¬Ëü£¬
<%!
 public String codeToString(String str)
 { ......

jspÁ¬½ÓÊý¾Ý¿âÈ«¼¯

¡¡ÏÖÔÚÓкöà³õѧjspµÄÍøÓѾ­³£»áÎÊÊý¾Ý¿âÔõôÁ¬½Ó°¡£¬ÔõôÀϳö´í°¡£¿ËùÒÔÎÒ¼¯ÖеÄÔÚÕâдƪÎÄÕ¹©´ó¼Ò²Î¿¼£¬ÆäʵÕâÖÖ°ÑÊý¾Ý¿âÂß¼­È«²¿·ÅÔÚjspÀïδ±ØÊǺõÄ×ö·¨£¬µ«ÊÇÓÐÀûÓÚ³õѧÕßѧϰ£¬ËùÒÔÎÒ¾ÍÕâÑù×öÁË£¬µ±´ó¼Òѧµ½Ò»¶¨³Ì¶ÈµÄʱºò£¬¿ÉÒÔ¿¼ÂÇÓÃMVCµÄģʽ¿ª·¢¡£ÔÚÁ·Ï°ÕâЩ´úÂëµÄʱºò£¬ÄãÒ»¶¨½«jdbcµÄÇý¶¯³ÌÐò·Åµ½·þÎñÆ÷µÄÀà ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØÍ¼ | ¸ÓICP±¸09004571ºÅ