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

jspÖÐ×Ô¶¨Òå±êÇ©×ܽá(Ò»)_´«Í³±êǩƪ

×Ô¶¨Òå±êÇ©ÊÇÈÿª·¢ÈËÔ±´´½¨¿Í»§»¯µÄ±êÇ©,²¢ÇÒÔÚjspÎļþÖÐʹÓÃÕâЩ±êÇ©,ÕâÑù¿ÉÒÔʹjsp´úÂë¸ü¼ò½à!
 Ê×ÏÈÕâÀïÏȽéÉÜ´Ó¶¨Òå±êÇ©µ½Ê¹ÓñêÇ©µÄ²½Öè:
     1,´´½¨×Ô¶¨Òå±êÇ©´¦ÀíÀà,¼°Ïà¹ØÀà.class ²¢ÇÒ°ÑËûÃǶ¼·ÅÔÚWEB-INF/classesĿ¼ÏÂ
     2,´´½¨TLD±êÇ©¿âÃèÊöÎļþ(.tld)Îļþ,·ÅÔÚWEB-INFÏ»òÆä×ÓĿ¼ÏÂ
     3,ÔÚwen.xmlÖÐÉùÃ÷ËùÒýÓõıêÇ©¿â
     4,jspÖÐʹÓñêÇ©¿â
 ½ÓÏÂÀ´½²Ò»²½Ò»²½½²½â
  
 ×Ô¶¨Òå±êÇ©´¦ÀíÀàÓÐÆäJSP Tag API,ËùÒÔ´´½¨×Ô¶¨Òå±êÇ©´¦ÀíÀàʱֻÐèҪʵÏÖÕâЩAPIÀ´´´½¨´¦ÀíÀà.
      µÚÒ»¸ö½Ó¿ÚÊÇJspTag,ÊÇÿ¸ö±êÇ©¶¼±ØÐëʵÏֵĽӿÚ,ûÓз½·¨.
      JspTagÏÂÃæÓÐÁ½¸ö½Ó¿ÚTagºÍSimpleTag½Ó¿Ú,´ú±íÁ½¸ö±êÇ©´¦ÀíÀà·½Ïò,ʵÏÖTag±êÇ©µÄ±»³ÆΪ´«Í³±êÇ©,ʵÏÖSimpleTag½Ó¿ÚµÄ±»³ÆΪ¼òµ¥±êÇ©
     ´«Í³±êÇ©
          Tag½Ó¿Ú¶¨ÒåÁ˼¸¸ö·½·¨,Ò²ÓÐÒ»¶¨µÄÖ´ÐÐ˳Ðò,ÔÚÓöµ½×Ô¶¨Òå±êǩʱÓÉÈÝÆ÷×Ô¶¯µ÷ÓÃÕâЩ·½·¨
          Ê×ÏÈ,setPageContext(pageContext pc)ºÍsetParent(Tag t)Á½¸ö·½·¨ÏÈÓÉÈÝÆ÷µ÷ÓÃ
          ½Ó×Å,ÉèÖñêÇ©µÄÊôÐÔ
          doStartTag()·½·¨,Óöµ½±êÇ©µÄÆðʼ±ê־ʱ¿ªÊ¼Ö´ÐÐ.Á½¸ö·µ»ØÖµ,Tag.SKIP_BODY±êÇ©Ö÷Ìå±»ºöÂÔ,Tag.EVAL_BODY_INCLUDE±êÇ©Ö÷Ìå±»Õý³£Ö´ÐÐ.
          doEndTag()·½·¨,Óöµ½±êÇ©½áÊø±ê־ʱ¿ªÊ¼Ö´Ðз½·¨,Á½¸ö·µ»ØÖµ,Tag.SKIP_PAGEºóÃæµÄËùÓдúÂë±»ºöÂÔµô,Tag.EVAL_PAGEÕý³£Ö´ÐÐ.
          ·µ»ØÏàÓ¦½á¹û
  
         ´«Í³±êÇ©µÄµÚ¶þ¸ö½Ó¿ÚÊÇIterationTag½Ó¿Ú,¼Ì³Ð×ÔTag½Ó¿Ú,ËùÒÔTag½Ó¿ÚµÄÖ´ÐÐÁ÷³ÌÒ²ÊÊÓÃÓÚËû,²»Í¬µÄÊÇIterationTag½Ó¿Ú»¹Ôö¼ÓÁËÖظ´Ö´ÐбêÇ©Ö÷ÌåµÄÄÚÈÝ! Õâ¸ö¹¦ÄÜÓÉdoAfterBody()·½·¨ÊµÏÖ,ÔÚÈÝÆ÷Ö´ÐÐÍê±êÇ©Ö÷ÌåÍêÒÔºó¾Í»áµ÷ÓÃdoAfterBody()·½·¨,ËüÒ²ÓÐÁ½¸ö·µ»ØÖµTag.SKIP_BODYµ±È»Õâ¸ö¸úÉÏÃæÊÇÒ»ÑùµÄ²»ÔÙÖ´ÐбêÇ©Ö÷ÌåÁË,¶îÍ


Ïà¹ØÎĵµ£º

jspµÇ¼½çÃæ+access


1¡¢Óû§µÇ¼½çÃælog.jsp
<%@ page contentType="text/html; charset=gb2312" language="java" import="java.sql.*" errorPage="" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content ......

JSPʵÀý¶þ¡¢µÇ¼ÑéÖ¤

·½·¨Ò»¡¢
login.html
<html>
  <head>
    <title>Óû§µÇ¼</title>
    <meta http-equiv="content-type" content="text/html; charset=gb2312">
  </head>
 
  <script language="javascript">
  &nbs ......

ÓÃJspÀ´ÊµÏÖÎļþÏÂÔع¦Äܵļ¸ÖÖ·½Ê½

 
£±.×îÖ±½Ó×î¼òµ¥µÄ£¬·½Ê½ÊÇ°ÑÎļþµØÖ·Ö±½Ó·Åµ½htmlÒ³ÃæµÄÒ»¸öÁ´½ÓÖС£ÕâÑù×öµÄȱµãÊÇ°ÑÎļþÔÚ·þÎñÆ÷ÉϵÄ·¾¶±©Â¶ÁË£¬²¢ÇÒ»¹ÎÞ·¨¶ÔÎļþÏÂÔؽøÐÐÆäËüµÄ¿ØÖÆ£¨ÈçȨÏÞ£©¡£Õâ¸ö¾Í²»Ð´Ê¾ÀýÁË¡£
 
£².ÔÚ·þÎñÆ÷¶Ë°ÑÎļþת»»³ÉÊä³öÁ÷£¬Ð´Èëµ½response£¬ÒÔresponse°ÑÎļþ´øµ½ä¯ÀÀÆ÷£¬ÓÉä¯ÀÀÆ÷À´ÌáʾÓû§ÊÇ·ñÔ¸Òâ±£´æÎ ......

jsp¼¸ÖÖ·½·¨

1.±ØÐë¼Ì³Ð×ÔHttpServlet
  2.±ØÐëʵÏÖdoGet()»òÕßdoPost()
  3.±ØÐëÔÚweb.xmlÖÐÅäÖÃServlet
  <servlet>
  <servlet-name> </servlet-name>
  <servlet-class> </servlet-class>
  </servlet>
  <servlet-mapping>
  ......

JSPÒ³ÃæEL±í´ïʽÎÞЧµÄÎÊÌâ

 ÒÔÇ°ÓÃWSAD wizard×öµÄ£¬¶¼¿ÉÒÔÔÚJSPÒ³ÃæÖнâÎöµ½EL±í´ïʽ£¬µ±È»Ç°ÌáÊÇJSP2.0µÄÇé¿öÏ¡£
½ñÌìÓöµ½ÁËÒ»¸öĪÃûÆäÃîµÄÎÊÌâ¡£¸ÕÏÂÔØEclipse3.3+MyEclipse6.0ÌåÑéµÄ¹ý³ÌÖУ¬ÓöÉÏÁ˽âÎö²»µ½EL±í´ïʽµÄÎÊÌâ¡£¾­¹ýºÃ¼¸¸öСʱµÄ×ÁÄ¥ÖÕÓÚ·¢ÏÖÁË£¬¸ø´ó¼Òshareһϣº
ÎÊÌâ¾Í³öÔÚ½¨Web ProjectµÄʱºòweb.xmlÉùÃ÷ÉÏ¡£
web.xml ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ