¡¾JSPѧϰ±Ê¼Ç¡¿ JSP֪ʶµã×ܽá
Ò»¡¢JSPµÄ¼¼ÊõÔÀí
¶þ¡¢JSPµÄ×¢ÊͺÍÉùÃ÷
JSP×¢ÊÍÓÃÓÚ±íÃ÷ÔÚ³ÌÐò¿ª·¢¹ý³ÌÖеĿª·¢Ìáʾ£¬²»»áÊä³öµ½¿Í»§¶Ë£»
<%--×¢ÊÍÄÚÈÝ--%> —— JSP×¢ÊÍ
<£¡--×¢ÊÍÄÚÈÝ--£¡> ——HTML×¢ÊÍ
Èý¡¢JSP½Å±¾
<%! ÉùÃ÷²¿·Ö %>
<%= ±í´ïʽ %>
<% JSP½Å±¾ %>
ËÄ¡¢JSPµÄÈý¸ö±àÒëÖ¸Áî
³£¼ûµÄ±àÒëÖ¸ÁîÓÐÈý¸ö£ºpage£¬Taglib£¬include£»
¸ñʽ£º<%@ ±àÒëÖ¸ÁîÃû ÊôÐÔÃû=“ÊôÐÔÖµ” … %>
page£º¸ÃÖ¸ÁîÊÇÕë¶Ôµ±Ç°Ò³ÃæµÄÖ¸Á
include:ÓÃÓÚÖ¸¶¨ÈçºÎ°üº¬ÁíÒ»¸öÒ³Ã棻
taglib£ºÓÃÓÚ¶¨ÒåºÍ·ÃÎÊ×Ô¶¨Òå±êÇ©£»
Îå¡¢JSPµÄÆ߸ö´¦ÀíÖ¸Áî
JSP¶¯×÷Ö¸ÁîÖ÷ÒªÓÐÒÔÏÂ7¸ö£º
jsp:forward :Ö´ÐÐÒ³ÃæתÏò£¬½«ÇëÇóµÄ´¦Àíת·¢µ½ÏÂÒ»¸öÒ³Ã棻
jsp:param :ÓÃÓÚ´«µÝ²ÎÊý£¬±ØÐëÓëÆäËûÖ§³Ö²ÎÊýµÄ±êÇ©Ò»ÆðʹÓã»
jsp:include £º ÓÃÓÚ¶¯Ì¬µÄÒýÈëÒ»¸öJSPÒ³Ã棻
jsp:plugin : ÓÃÓÚÏÂÔØJavaBean»òÕßAppletµ½¿Í»§¶ËÖ´ÐУ»
jsp:useBean £º ʹÓÃJavaBean£»
jsp:setProperty £º ÐÞ¸ÄJavaBeanʵÀýµÄÊôÐÔÖµ£»
jsp:getProperty : »ñÈ¡JavaBeanʵÀýµÄÊôÐÔÖµ£»
Áù¡¢JSPµÄ¾Å¸öÄÚÖöÔÏó
application£º
config£º
exception:
out
page:
pageContext:
request:
response:
session:
Æß¡¢Servlet½éÉÜ
°Ë¡¢Filter£¬Listener
¾Å¡¢JSP2.0ÐÂÌØÐÔ
±í´ïʽÓïÑÔ£ºEL
¼ò»¯µÄ×Ô¶¨Òå±êÇ©API
TAGÎļþÓï·¨
&nb
Ïà¹ØÎĵµ£º
1¡¢Í¨¹ý<s:form
action="ÌøתҳÃæ">Ìá½»Öµ£¬µ«ÊÇÔÚ<s:form>±êÇ©ÖеÄactionºóÃæÖÁ¶àÖ»ÄܸúÒ»¸ö²ÎÊý£¬²¢ÇÒ»¹»á±¨¾¯¸æ£¬ËùÒÔÈç¹û
Ïë´«µÝ²ÎÊý¿ÉÒÔÓÃ<s:hidden name=""
values="username"></s:hidden>À´´«Öµ£¬µ«ÊÇÕý¹æµÄд·¨ÐèÒªÅäºÏ<s:set>±êÇ©À´ÓÃ
È磺
......
Ô´³ÌÐò
<%String sConn="ÄãµÄÁ¬½Ó"
Class.forName("oracle.jdbc.driver.OracleDriver");
Connection conn=DriverManager.getConnection(sConn,"ÄãµÄÓû§Ãû","ÃÜÂë");
Statement stmt=conn.createStatement(ResultSet.TYPE_SCROLL_SENSITIVE,ResultSet.CONCUR_UPDATABLE);
Statement stmtcount=conn.createStat ......
Á¬Ðø¼¸Ìì°²×°ÅäÖúÍÁ¬½ÓMysqlÊý¾Ý¿â£¬½ñÌìÖÕÓڳɹ¦ÁË£¬»ØÏëÕ⼸Ì죬ÕæµÄÊÇÌðËá¿àÀ±¶¼ÓУ¬µ¥mysql¾ÍÖØ×°Á˲»ÏÂ10´Î£¬¶øÔÚeclipseÉϱàдµÄÁ¬½ÓÊý¾Ý¿âµÄ³ÌÐò×ÜÊDZ¨´í£®ÎÒ¶¼ÒѾdownÁËoracal×¼±¸·ÅÆúmysqlÁË£¬²»¹ý£®£®£®¾ÍÏóµçÊÓ¾çÑݵÄÄÇÑù£¬×ª»ú×ÜÊÇÔÚÕâ¸öʱºò³öÏÖ£¬ÏÈÊÇ¿´µ½ÁËsaulzy¹ØÓÚmysql4.1.11°æ±¾µÄ°²×°½éÉÜ£¬½Ó×ÅÓÖÕ ......
Àý×Ó˵Ã÷£ºÕâÀý×ÓÊÇѧÉú»ù±¾ÐÅÏ¢µÄÊäÈëÒÔ¼°Êä³öÏÔʾ;ÓÐÁ½¸öÒ³Ã棺info.jspºÍshowInfo.jsp£¬Ç°ÕßÊǹ˿ÍÊäÈëµÄÐÅÏ¢Ò³Ã棬¶øºóÕßÊÇ´¦ÀíÐÅÏ¢µÄÒ³Ãæ¡£
info.jsp
<%@page contentType="text/html;charset=gb2312"%>
<HTML>
<HEAD>
<TITLE>ÊäÈëѧ ......
application£ºÈ«¾Ö×÷Ó÷¶Î§£¬Õû¸öÓ¦ÓóÌÐò¹²Ïí£¬¾ÍÊÇÔÚ²¿ÊðÎļþÖеÄͬһ¸öwebApp¹²Ïí£¬ÉúÃüÖÜÆÚΪ£ºÓ¦ÓóÌÐòÆô¶¯µ½Í£Ö¹¡£
session£º»á»°×÷ÓÃÓò£¬µ±Óû§Ê״ηÃÎÊʱ£¬²úÉúÒ»¸öеĻỰ£¬ÒÔºó·þÎñÆ÷¾Í¿ÉÒÔ¼ÇסÕâ¸ö»á»°×´Ì¬¡£ÉúÃüÖÜÆÚ£º»á»°³¬Ê±£¬»òÕß·þÎñÆ÷¶ËÇ¿ÖÆʹ»á»°Ê§Ð§¡£
sessionÊÇÕë¶Ôµ¥¸ö¿Í»§ºÍ·þÎñÆ÷½øÐлỰµÄ  ......