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();
%>
Ïà¹ØÎĵµ£º
[list=1]
ÎÒÃÇÔÚ×öÑéÖ¤ÂëµÄʱºòÍùÍùÓÉÓÚÒª·´×÷±×£¬ÑéÖ¤ÓÐʱ¹ÊÒâ¼ÓÈë¶àµÄ¸ÉÈÅÒòËØ£¬ÕâʱÑéÖ¤ÂëÏÔʾ²»ºÜÇå³þ£¬Óû§¾³£ÊäÈë´íÎó¡£ÕâÑù²»µ«ÒªÖØÐÂË¢ÐÂÒ³Ãæ£¬µ¼ÖÂÓû§Ã»Óп´Çå³þÑéÖ¤Âë¶øÖØÌî¶ø²»ÊÇÐ޸쬶øÇÒÈç¹ûûÓÐÓÃsession±£´æÏÂÓû§ÊäÈëµÄÆäËüÊý¾ÝµÄ»°(ÈçÐÕÃû)£¬Óû§¸Õ¸ÕÊäÈëµÄÄÚÈÝÒ²²»´æÔÚÁË£¬ÕâÑù¸øÓû§Ôì³É²»ºÃµÄÌåÑé ......
×¢ÊÍ
ÔÚ¿Í»§¶ËÏÔʾһ¸ö×¢ÊÍ.
JSP Óï·¨
<!-- comment [ <%= expression %> ] -->
Àý×Ó 1
<!-- This file displays the user login screen -->
ÔÚ¿Í»§¶ËµÄHTMLÔ´´úÂëÖвúÉúºÍÉÏÃæÒ»ÑùµÄÊý¾Ý£º
<!-- This file displays the user login screen -->
Àý×Ó 2
<!-- This page was lo ......
ÔÚjspÖÐʹÓÃsmartupload×é¼þÉÏ´«Îļþ
jsp¶ÔÉÏ´«ÎļþµÄÖ§³Ö²»ÏóphpÖÐÖ§³ÖµÄÄÇôºÃ£¬Ö±½Ó×ö³ÉÁ˺¯Êý£¬Ò²²»ÏóaspÖÐҪͨ¹ý×é¼þ²ÅÄÜʵÏÖ¡£jspÖпÉÒÔͨ¹ýjavabeanÀ´ÊµÏÖ¡£µ«ÊÇÎÒÃÇûÓбØÒª×Ô¼ºÈ¥Ð´Ò»¸öÉÏÔØµÄbean£¬ÔÚÍøÉÏÒѾÓÐÁ˺ܶà³ÉÐ͵ļ¼Êõ£¬smartupload¾ÍÊÇÆäÖеÄÒ»¸ö¡£µ«ÊÇsmartuploadÊǽ«ÎļþÏȶÁµ ......
member.jsp //sessionÏÞÖÆ·ÃÎÊÒ³
<%
String url = ""
if(session.getAttribute("username")==null)
{
url = myRedirect.dealurl(request);//¼Ç¼µ±Ç°µØÖ·ºÍÇëÇó²ÎÊý£¬dealurl½«Êµ¼Êurl´¦ÀíÁ˱ÜÃâºÍÒªÇëÇóurlÓиÉÈÅ,ÒòΪ»áÓÐ& ×Ö·û
......
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<%@ page contentType="text/html; charset=gb2312" language="java"
import="java.sql.*"%>
<%
/*********************
&nb ......