Ò׽ؽØÍ¼Èí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö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();
%>


Ïà¹ØÎĵµ£º

includeºÍjsp:include

index.jsp:
<html>
<head>
<title>The News</title>
</head>
<body>
<h1> Latest News</h1>
<table>
<tr>
<td><h3><%@include file="items/news1.jsp" %></h3></td>
</tr>
<tr>
<td> ......

jspµÄweb.xmlÅäÖÃ˵Ã÷

Web.xml³£ÓÃÔªËØ
<web-app>
<display-name></display-name>¶¨ÒåÁËWEBÓ¦ÓõÄÃû×Ö
<description></description> ÉùÃ÷WEBÓ¦ÓõÄÃèÊöÐÅÏ¢
<context-param></context-param> context-paramÔªËØÉùÃ÷Ó¦Ó÷¶Î§Äڵijõʼ»¯²ÎÊý¡£
<filter></filter> ¹ýÂËÆ÷ÔªËØ½«Ò»¸ ......

JSP×Ô¶¨Òå±êǩʵÏÖ¹ý³Ì

 http://www.soft6.com/tech/16/160477.html
ʵÏÖtagµÄÀࣨ±êÇ©´¦ÀíÆ÷£©(tag handler)
1£¬ÊÇһЩÔÚÒýÓÃÁ˱êÇ©µÄJSPÒ³ÃæÖ´ÐÐÆÚ¼ä±»Web Containerµ÷ÓÃÒÔÇó×Ô¶¨Òå±êǩֵµÄ¶ÔÏó;
2£¬±ØÐëʵÏÖTag, SimpleTagºÍBodyTagÖ®Ò»
3£¬¿ÉÒԼ̳ÐTagSupportºÍBodyTagSupportÖ®Ò»
±êÇ©¿âµÄ½Ó¿ÚºÍÀàµÄ¼Ì³Ð¹ØÏµ½Ó¿ÚµÄ¼Ì³Ð¹ØÏµ£º  ......

×Ô¶¨ÒåJSP±êÇ©


Ò»¸öÏîÄ¿ÖлáÔÚ¶à¸öJSP½çÃæÖÐʹÓÃÏÂÀ­¿ò£¬ÈÕÆÚ¿Ø¼þ£¬·ÖÒ³¿Ø¼þ¡£ÈôÄܽ«´ËÀà¿Ø¼þ³éÏó³öÀ´£¬×ö³ÉÒ»¸öJspTagµÄ»°£¬ÄÇʹÓÃÆðÀ´¾Í·½±ã¶àÁË¡£Í¬Ê±±ãÓÚJSPµÄÔĶÁ£¬¸üÖ÷ÒªµÄÊÇ·½±ãÁËÏîÄ¿µÄ¹ÜÀíÓëά»¤¡£
ÏÂÃæÒÔÐÐÒµÏÂÀ­¿ò¿Ø¼þΪÀý½éÉÜ×Ô¶¨ÒåJspTag£¬ÓÈÆä×¢ÒâºìÉ«±ê×¢´¦£¬´Ó¶ÔÓ¦¹ØÏµ¿ÉÒÔÕÒµ½ÔËÓùæÂÉ£º
Ê×ÏȽ¨Á¢/WEB-INF/tags/my-t ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØÍ¼ | ¸ÓICP±¸09004571ºÅ