»áÔ±£º ÃÜÂ룺 ¡¡Ãâ·Ñ×¢²á | Íü¼ÇÃÜÂë | »áÔ±µÇ¼ ÍøÒ³¹¦ÄÜ£º ¼ÓÈëÊÕ²Ø ÉèΪÊ×Ò³ ÍøÕ¾ËÑË÷  
 °²È«¼¼Êõ¼¼ÊõÎĵµ
  ¡¤ °²È«ÅäÖÆ
  ¡¤ ¹¤¾ß½éÉÜ
  ¡¤ ºÚ¿Í½Ìѧ
  ¡¤ ·À»ðǽ
  ¡¤ Â©¶´·ÖÎö
  ¡¤ ÆƽâרÌâ
  ¡¤ ºÚ¿Í±à³Ì
  ¡¤ ÈëÇÖ¼ì²â
 °²È«¼¼ÊõÂÛ̳
  ¡¤ °²È«ÅäÖÆ
  ¡¤ ¹¤¾ß½éÉÜ
  ¡¤ ·À»ðǽ
  ¡¤ ºÚ¿ÍÈëÇÖ
  ¡¤ Â©¶´¼ì²â
  ¡¤ Æƽⷽ·¨
  ¡¤ É±¶¾×¨Çø
 °²È«¼¼Êõ¹¤¾ßÏÂÔØ
  ¡¤ É¨Ã蹤¾ß
  ¡¤ ¹¥»÷³ÌÐò
  ¡¤ ºóÃÅľÂí
  ¡¤ ¾Ü¾ø·þÎñ
  ¡¤ ¿ÚÁîÆƽâ
  ¡¤ ´úÀí³ÌÐò
  ¡¤ ·À»ðǽ
  ¡¤ ¼ÓÃܽâÃÜ
  ¡¤ ÈëÇÖ¼ì²â
  ¡¤ ¹¥·ÀÑÝʾ
¼¼ÊõÎĵµ > Web¿ª·¢ > JSP
JSP±à³Ì½ø¶ÈÌõÉè¼ÆʵÀý
·¢±íÈÕÆÚ£º2004-03-16 00:00:00×÷ÕߣºÓ ³ö´¦£º  

¡¡¡¡Ðí¶àWebÓ¦Óá¢ÆóÒµÓ¦ÓÃÉæ¼°µ½³¤Ê±¼äµÄ²Ù×÷£¬ÀýÈ縴ÔÓµÄÊý¾Ý¿â²éѯ»ò·±ÖصÄXML´¦ÀíµÈ£¬ËäÈ»ÕâЩÈÎÎñÖ÷ÒªÓÉÊý¾Ý¿âϵͳ»òÖмä¼þÍê³É£¬µ«ÈÎÎñÖ´ÐеĽá¹ûÈÔ¾ÉÒª½èÖúJSP²ÅÄÜ·¢Ë͸øÓû§¡£±¾ÎĽéÉÜÁËÒ»ÖÖͨ¹ý¸Ä½øÇ°¶Ë±íÏÖ²ãÀ´¸ÄÉÆÓû§¸Ð¾õ¡¢¼õÇá·þÎñÆ÷¸ºÔصİ취¡£

¡¡¡¡µ±JSPµ÷ÓÃÒ»¸ö±ØÐ볤ʱ¼äÔËÐеIJÙ×÷£¬ÇҸòÙ×÷µÄ½á¹û²»ÄÜ£¨ÔÚ·þÎñÆ÷¶Ë£©»º³å£¬Óû§Ã¿´ÎÇëÇó¸ÃÒ³Ãæʱ¶¼±ØÐ볤ʱ¼äµÈ´ý¡£ºÜ¶àʱºò£¬Óû§»áʧȥÄÍÐÄ£¬½Ó×ų¢ÊÔµã»÷ä¯ÀÀÆ÷µÄˢа´Å¥£¬×îÖÕʧÍûµØÀ뿪¡£

¡¡¡¡±¾ÎĽéÉܵļ¼ÊõÊÇ°Ñ·±ÖصļÆËãÈÎÎñ·ÖÀ뿪À´£¬ÓÉÒ»¸ö¶ÀÁ¢µÄÏß³ÌÔËÐУ¬´Ó¶ø½â¾öÉÏÊöÎÊÌâ¡£µ±Óû§µ÷ÓÃJSPÒ³Ãæʱ£¬JSPÒ³Ãæ»áÁ¢¼´·µ»Ø£¬²¢ÌáʾÓû§ÈÎÎñÒѾ­Æô¶¯ÇÒÕýÔÚÖ´ÐУ»JSPÒ³Ãæ×Ô¶¯Ë¢ÐÂ×Ô¼º£¬±¨¸æÔÚ¶ÀÁ¢Ïß³ÌÖÐÔËÐеķ±ÖؼÆËãÈÎÎñµÄµ±Ç°½ø¶È£¬Ö±ÖÁÈÎÎñÍê³É¡£

Ò»¡¢Ä£ÄâÈÎÎñ

¡¡¡¡Ê×ÏÈÎÒÃÇÉè¼ÆÒ»¸öTaskBeanÀ࣬ËüʵÏÖjava.lang.Runnable½Ó¿Ú£¬Æärun()·½·¨ÔÚÒ»¸öÓÉJSPÒ³Ã棨start.jsp£©Æô¶¯µÄ¶ÀÁ¢Ïß³ÌÖÐÔËÐС£ÖÕÖ¹run()·½·¨Ö´ÐÐÓÉÁíÒ»¸öJSPÒ³Ãæstop.jsp¸ºÔð¡£TaskBeanÀ໹ʵÏÖÁËjava.io.Serializable½Ó¿Ú£¬ÕâÑùJSPÒ³Ãæ¾Í¿ÉÒÔ½«Ëü×÷ΪJavaBeanµ÷Óãº

package test.barBean;

import java.io.Serializable;

public class TaskBean implements Runnable, Serializable {

  private int counter;

  private int sum;

  private boolean started;

  private boolean running;

  private int sleep;

  public TaskBean() {

    counter = 0;

    sum   = 0;

    started = false;

    running = false;

    sleep  = 100;

  }

}

¡¡¡¡TaskBean°üº¬µÄ¡°·±ÖØÈÎÎñ¡±ÊǼÆËã1+2+3¡­+100µÄÖµ£¬²»¹ýËü²»Í¨¹ý100*(100+1)/2=5050¹«Ê½¼ÆË㣬¶øÊÇÓÉrun()·½·¨µ÷ÓÃwork()·½·¨100´ÎÍê³É¼ÆËã¡£work()·½·¨µÄ´úÂëÈçÏÂËùʾ£¬ÆäÖе÷ÓÃThread.sleep()ÊÇΪÁËÈ·±£ÈÎÎñ×ܺÄʱԼ10Ãë¡£

protected void work() {

  try {

    Thread.sleep(sleep);

    counter++;

    sum += counter;

  } catch (InterruptedException e) {

    setRunning(false);

  }

}

¡¡¡¡status.jspÒ³Ãæͨ¹ýµ÷ÓÃÏÂÃæµÄgetPercent()·½·¨»ñµÃÈÎÎñµÄÍê³É×´¿ö£º

public synchronized int getPercent() {

  return counter;

}

¡¡¡¡Èç¹ûÈÎÎñÒѾ­Æô¶¯£¬isStarted()·½·¨½«·µ»Øtrue£º

public synchronized boolean isStarted() {

  return started;

}

¡¡¡¡Èç¹ûÈÎÎñÒѾ­Íê³É£¬isCompleted()·½·¨½«·µ»Øtrue£º

public synchronized boolean isCompleted() {

  return counter == 100;

}

¡¡¡¡Èç¹ûÈÎÎñÕýÔÚÔËÐУ¬isRunning()·½·¨½«·µ»Øtrue£º

public synchronized boolean isRunning() {

  return running;

}

¡¡¡¡SetRunning()·½·¨ÓÉstart.jsp»òstop.jspµ÷Ó㬵±running²ÎÊýÊÇtrueʱ¡£SetRunning()·½·¨»¹Òª½«ÈÎÎñ±ê¼ÇΪ¡°ÒѾ­Æô¶¯¡±¡£µ÷ÓÃsetRunning(false)±íʾҪÇórun()·½·¨Í£Ö¹Ö´ÐС£

public synchronized void setRunning(boolean running) {

  this.running = running;

  if (running)

    started = true;

}

¡¡¡¡ÈÎÎñÖ´ÐÐÍê±Ïºó£¬µ÷ÓÃgetResult()·½·¨·µ»Ø¼ÆËã½á¹û£»Èç¹ûÈÎÎñÉÐδִÐÐÍê±Ï£¬Ëü·µ»Ønull£º

public synchronized Object getResult() {

  if (isCompleted())

    return new Integer(sum);

  else

    return null;

}

¡¡¡¡µ±running±ê¼ÇΪtrue¡¢completed±ê¼ÇΪfalseʱ£¬run()·½·¨µ÷ÓÃwork()¡£ÔÚʵ¼ÊÓ¦ÓÃÖУ¬run()·½·¨Ò²ÐíÒªÖ´Ðи´ÔÓµÄSQL²éѯ¡¢½âÎö´óÐÍXMLÎĵµ£¬»òÕßµ÷ÓÃÏûºÄ´óÁ¿CPUʱ¼äµÄEJB·½·¨¡£×¢Òâ¡°·±ÖصÄÈÎÎñ¡±¿ÉÄÜÒªÔÚÔ¶³Ì·þÎñÆ÷ÉÏÖ´ÐС£±¨¸æ½á¹ûµÄJSPÒ³ÃæÓÐÁ½ÖÖÑ¡Ôñ£º»òÕߵȴýÈÎÎñ½áÊø£¬»òÕßʹÓÃÒ»¸ö½ø¶ÈÌõ¡£

public void run() {

  try {

    setRunning(true);

    while (isRunning() && !isCompleted())

      work();

  } finally {

    setRunning(false);

  }

}

¡¡¡¡¶þ¡¢Æô¶¯ÈÎÎñ

¡¡¡¡start.jspÊÇweb.xml²¿ÊðÃèÊö·ûÖÐÉùÃ÷µÄ»¶Ó­Ò³Ã棬web.xmlµÄÄÚÈÝÊÇ£º

<?xml version="1.0" encoding="GB2312"?>

<!DOCTYPE web-app

  PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"

  "http://java.sun.com/dtd/web-app_2_3.dtd">

<web-app>

  <welcome-file-list>

    <welcome-file>start.jsp</welcome-file>

  </welcome-file-list>

</web-app>

¡¡¡¡start.jspÆô¶¯Ò»¸öרÓõÄÏß³ÌÀ´ÔËÐС°·±ÖصÄÈÎÎñ¡±£¬È»ºó°ÑHTTPÇëÇ󴫵ݸøstatus.jsp¡£

¡¡¡¡start.jspÒ³ÃæÀûÓÃ<jsp:useBean>±ê¼Ç´´½¨Ò»¸öTaskBeanµÄʵÀý£¬½«scopeÊôÐÔ¶¨ÒåΪsessionʹµÃ¶ÔÓÚÀ´×Ôͬһä¯ÀÀÆ÷µÄHTTPÇëÇó£¬ÆäËûÒ³ÃæÒ²ÄÜÌáÈ¡µ½Í¬Ò»¸öBean¶ÔÏó¡£start.jspͨ¹ýµ÷ÓÃsession.removeAttribute("task")È·±£<jsp:useBean>´´½¨ÁËÒ»¸öеÄBean¶ÔÏ󣬶ø²»ÊÇÌáÈ¡Ò»¸ö¾É¶ÔÏó£¨ÀýÈ磬ͬһ¸öÓû§»á»°ÖиüÔçµÄJSPÒ³ÃæËù´´½¨µÄBean¶ÔÏ󣩡£

¡¡¡¡ÏÂÃæÊÇstart.jspÒ³ÃæµÄ´úÂëÇåµ¥£º

<% session.removeAttribute("task"); %>

<jsp:useBean id="task" scope="session"

  class="test.barBean.TaskBean"/>

<% task.setRunning(true); %>

<% new Thread(task).start(); %>

<jsp:forward page="status.jsp"/>

¡¡¡¡start.jsp´´½¨²¢ÉèÖúÃTaskBean¶ÔÏóÖ®ºó£¬½Ó×Å´´½¨Ò»¸öThread£¬²¢½«Bean¶ÔÏó×÷Ϊһ¸öRunnableʵÀý´«Èë¡£µ÷ÓÃstart()·½·¨Ê±Ð´´½¨µÄÏ߳̽«Ö´ÐÐTaskBean¶ÔÏóµÄrun()·½·¨¡£

¡¡¡¡ÏÖÔÚÓÐÁ½¸öÏß³ÌÔÚ²¢·¢Ö´ÐУºÖ´ÐÐJSPÒ³ÃæµÄỊ̈߳¨³Æ֮Ϊ¡°JSPÏ̡߳±£©£¬ÓÉJSPÒ³Ãæ´´½¨µÄỊ̈߳¨³Æ֮Ϊ¡°ÈÎÎñÏ̡߳±£©¡£½ÓÏÂÀ´£¬start.jspÀûÓõ÷ÓÃstatus.jsp£¬status.jspÏÔʾ³ö½ø¶ÈÌõÒÔ¼°ÈÎÎñµÄÖ´ÐÐÇé¿ö¡£×¢Òâstatus.jspºÍstart.jspÔÚͬһ¸öJSPÏß³ÌÖÐÔËÐС£

¡¡¡¡start.jspÔÚ´´½¨Ïß³Ì֮ǰ¾Í°ÑTaskBeanµÄrunning±ê¼ÇÉèÖóÉÁËtrue£¬ÕâÑù£¬¼´Ê¹µ±JSPÏß³ÌÒÑ¿ªÊ¼Ö´ÐÐstatus.jsp¶øÈÎÎñÏ̵߳Ärun()·½·¨ÉÐδÆô¶¯£¬Ò²Äܹ»È·±£Óû§»áµÃµ½¡°ÈÎÎñÒÑ¿ªÊ¼ÔËÐС±µÄ״̬±¨¸æ¡£

¡¡¡¡½«running±ê¼ÇÉèÖóÉtrue¡¢Æô¶¯ÈÎÎñÏß³ÌÕâÁ½ÐдúÂë¿ÉÒÔÒÆÈëTaskBean¹¹³ÉÒ»¸öеķ½·¨£¬È»ºóÓÉJSPÒ³Ãæµ÷ÓÃÕâ¸öз½·¨¡£Ò»°ã¶øÑÔ£¬JSPÒ³ÃæÓ¦µ±¾¡Á¿ÉÙÓÃJava´úÂ룬¼´ÎÒÃÇÓ¦µ±¾¡¿ÉÄܵذÑJava´úÂë·ÅÈëJavaÀà¡£²»¹ý±¾ÀýÖÐÎÒÃDz»×ñ´ÓÕâÒ»¹æÔò£¬°Ñnew Thread(task).start()Ö±½Ó·ÅÈëstart.jspÍ»³ö±íÃ÷JSPÏ̴߳´½¨²¢Æô¶¯ÁËÈÎÎñÏ̡߳£

¡¡¡¡ÔÚJSPÒ³ÃæÖвÙ×÷¶àÏ̱߳ØÐë½÷É÷£¬×¢ÒâJSPÏ̺߳ÍÆäËüÏß³Ìʵ¼ÊÉÏÊDz¢·¢Ö´Ðеģ¬¾ÍÏóÔÚ×ÀÃæÓ¦ÓóÌÐòÖУ¬ÎÒÃÇÓÃÒ»¸öÏß³ÌÀ´´¦ÀíGUIʼþ£¬ÁíÍâÔÙÓÃÒ»¸ö»ò¶à¸öÏß³ÌÀ´´¦Àíºǫ́ÈÎÎñ¡£²»¹ýÔÚJSP»·¾³ÖУ¬¿¼Âǵ½¶à¸öÓû§Í¬Ê±ÇëÇóijһ¸öÒ³ÃæµÄÇé¿ö£¬Í¬Ò»¸öJSPÒ³Ãæ¿ÉÄÜ»áÔÚ¶à¸öÏß³ÌÖÐͬʱÔËÐУ»ÁíÍ⣬ÓÐʱͬһ¸öÓû§¿ÉÄÜ»áÏòͬһ¸öÒ³Ãæ·¢³ö¶à¸öÇëÇó£¬ËäÈ»ÕâЩÇëÇóÀ´×Ôͬһ¸öÓû§£¬ËüÃÇÒ²»áµ¼Ö·þÎñÆ÷ͬʱÔËÐÐÒ»¸öJSPÒ³ÃæµÄ¶à¸öÏ̡߳£

¡¡¡¡Èý¡¢ÈÎÎñ½ø¶È

¡¡¡¡status.jspÒ³ÃæÀûÓÃÒ»¸öHTML½ø¶ÈÌõÏòÓû§ÏÔʾÈÎÎñµÄÖ´ÐÐÇé¿ö¡£Ê×ÏÈ£¬status.jspÀûÓÃ<jsp:useBean>±ê¼Ç»ñµÃstart.jspÒ³Ãæ´´½¨µÄBean¶ÔÏó£º

<jsp:useBean id="task" scope="session"

  class="test.barBean.TaskBean"/>

¡¡¡¡ÎªÁ˼°Ê±·´Ó³ÈÎÎñÖ´Ðнø¶È£¬status.jsp»á×Ô¶¯Ë¢Ð¡£JavaScript´úÂësetTimeout("location='status.jsp'", 1000)½«Ã¿¸ô1000ºÁÃëË¢ÐÂÒ³Ã棬ÖØÐÂÇëÇóstatus.jsp£¬²»ÐèÒªÓû§¸ÉÔ¤¡£

<HTML>

<HEAD>

  <TITLE>JSP½ø¶ÈÌõ</TITLE>

  <% if (task.isRunning()) { %>

    <SCRIPT LANGUAGE="JavaScript">

      setTimeout("location='status.jsp'", 1000);

    </SCRIPT>

  <% } %>

</HEAD>

<ODY>

¡¡¡¡½ø¶ÈÌõʵ¼ÊÉÏÊÇÒ»¸öHTML±í¸ñ£¬°üº¬10¸öµ¥Ôª¡ª¡ª¼´Ã¿¸öµ¥Ôª´ú±íÈÎÎñ×ÜÌåµÄ10%½ø¶È¡£

<H1 ALIGN="CENTER">JSP½ø¶ÈÌõ</H1>

  <H2 ALIGN="CENTER">

    ½á¹û: <%= task.getResult() %><BR>

    <% int percent = task.getPercent(); %>

    <%= percent %>%

  </H2>

  <TABLE WIDTH="60%" ALIGN="CENTER"

      BORDER=1 CELLPADDING=0 CELLSPACING=2>

    <TR>

      <% for (int i = 10; i <= percent; i += 10) { %>

        <TD WIDTH="10%" BGCOLOR="#000080"> </TD>

      <% } %>

      <% for (int i = 100; i > percent; i -= 10) { %>

        <TD WIDTH="10%"> </TD>

      <% } %>

    </TR>

  </TABLE>

¡¡¡¡ÈÎÎñÖ´ÐÐÇé¿ö·ÖÏÂÃ漸ÖÖ״̬£ºÕýÔÚÖ´ÐУ¬ÒÑÍê³É£¬ÉÐδ¿ªÊ¼£¬ÒÑÍ£Ö¹£º

<TABLE WIDTH="100%" BORDER=0 CELLPADDING=0 CELLSPACING=0>

    <TR>

      <TD ALIGN="CENTER">

        <% if (task.isRunning()) { %>

          ÕýÔÚÖ´ÐÐ

        <% } else { %>

          <% if (task.isCompleted()) { %>

            Íê³É

          <% } else if (!task.isStarted()) { %>

            ÉÐδ¿ªÊ¼

          <% } else { %>

            ÒÑÍ£Ö¹

          <% } %>

        <% } %>

      </TD>

    </TR>

 

¡¡¡¡Ò³Ãæµ×²¿ÌṩÁËÒ»¸ö°´Å¥£¬Óû§¿ÉÒÔÓÃËüÀ´Í£Ö¹»òÖØÐÂÆô¶¯ÈÎÎñ£º

<TR>

      <TD ALIGN="CENTER">

        <BR>

        <% if (task.isRunning()) { %>

          <FORM METHOD="GET" ACTION="stop.jsp">

            <INPUT TYPE="SUBMIT" VALUE="Í£Ö¹">

          </FORM>

        <% } else { %>

          <FORM METHOD="GET" ACTION="start.jsp">

            <INPUT TYPE="SUBMIT" VALUE="¿ªÊ¼">

          </FORM>

        <% } %>

      </TD>

    </TR>

  </TABLE>

</BODY></HTML>

¡¡¡¡Ö»Òª²»Í£Ö¹ÈÎÎñ£¬Ô¼10Ãëºóä¯ÀÀÆ÷½«ÏÔʾ³ö¼ÆËã½á¹û5050£º

¡¡¡¡ËÄ¡¢Í£Ö¹ÈÎÎñ

¡¡¡¡stop.jspÒ³Ãæ°Ñrunning±ê¼ÇÉèÖóÉfalse£¬´Ó¶øÍ£Ö¹µ±Ç°µÄ¼ÆËãÈÎÎñ£º

<jsp:useBean id="task" scope="session"

  class="test.barBean.TaskBean"/>

<% task.setRunning(false); %>

<jsp:forward page="status.jsp"/>

¡¡¡¡×¢Òâ×îÔçµÄJava°æ±¾ÌṩÁËThread.stop·½·¨£¬µ«JDK´Ó1.2°æ¿ªÊ¼ÒѾ­²»ÔÞ³ÉʹÓÃThread.stop·½·¨£¬ËùÒÔÎÒÃDz»ÄÜÖ±½Óµ÷ÓÃThread.stop()¡£

¡¡¡¡µÚÒ»´ÎÔËÐб¾ÎijÌÐòµÄʱºò£¬Äã»á¿´µ½ÈÎÎñµÄÆô¶¯ÓеãÑÓ³Ù£»Í¬ÑùµØ£¬µÚÒ»´Îµã»÷¡°Í£Ö¹¡±°´Å¥Ê±Ò²¿ÉÒÔ¿´µ½ÈÎÎñ²¢Ã»ÓÐÁ¢¼´Í£Ö¹ÔËÐУ¨ÌرðÊÇÈç¹û»úÆ÷ÅäÖýϵ͵Ļ°£¬Ñӳٵĸоõ¸ü¼ÓÃ÷ÏÔ£©£¬ÕâЩÑÓ³Ù¶¼ÊÇÓÉÓÚ±àÒëJSPÒ³Ãæµ¼Öµġ£±àÒëºÃJSPÒ³ÃæÖ®ºó£¬Ó¦´ðËٶȾÍÒª¿ì¶àÁË¡£

¡¡¡¡Î塢ʵ¼ÊÓ¦ÓÃ

¡¡¡¡½ø¶ÈÌõ²»½öʹµÃÓû§½çÃæ¸ü¼ÓÓѺ㬶øÇÒ¶Ô·þÎñÆ÷µÄÐÔÄÜÒ²Óкô¦£¬ÒòΪ½ø¶ÈÌõ»á²»¶ÏµØ¸æËßÓû§µ±Ç°µÄÖ´Ðнø¶È£¬Óû§²»»áÔÙƵ·±µØÍ£Ö¹²¢ÖØÐÂÆô¶¯£¨Ë¢Ð£©µ±Ç°µÄÈÎÎñ¡£ÁíÒ»·½Ã棬´´½¨µ¥¶ÀµÄÏß³ÌÀ´Ö´Ðкǫ́ÈÎÎñÒ²»áÏûºÄ²»ÉÙ×ÊÔ´£¬±ØҪʱ¿É¿¼ÂÇͨ¹ýÒ»¸öÏ̳߳ØÀ´ÊµÏÖThread¶ÔÏóµÄÖØÓá£ÁíÍ⣬Ƶ·±µØˢнø¶ÈÒ³ÃæÒ²Ôö¼ÓÁËÍøÂçͨÐÅ¿ªÏú£¬ËùÒÔÎñ±Ø±£³Ö½ø¶ÈÒ³Ãæ¼ò½à¶ÌС¡£

¡¡¡¡ÔÚʵ¼ÊÓ¦ÓÃÖУ¬ºǫִ́Ðеķ±ÖØÈÎÎñ¿ÉÄܲ»ÔÊÐíÍ£Ö¹£¬»òÕßËü²»ÄÜÌṩÏêϸµÄÖ´Ðнø¶ÈÊý¾Ý¡£ÀýÈ磬²éÕÒ»ò¸üйØϵÊý¾Ý¿âʱ£¬SQLÃüÁîÖ´ÐÐÆڼ䲻ÔÊÐíÖÐ;ֹͣ¡ª¡ª²»¹ýÈç¹ûÓû§±íʾËûÏëҪֹͣ»òÖÐÖ¹ÈÎÎñ£¬³ÌÐò¿ÉÒÔÔÚSQLÃüÁîÖ´ÐÐÍê±Ïºó»ØÍËÊÂÎñ¡£

¡¡¡¡½âÎöXMLÎĵµµÄʱºò£¬ÎÒÃÇûÓа취»ñÖªÒѽâÎöÄÚÈݾ«È·µÄ°Ù·Ö±È¡£Èç¹ûÓÃDOM½âÎöXMLÎĵµ£¬Ö±µ½½âÎöÍê³Éºó²ÅµÃµ½Õû¸öÎĵµÊ÷£»Èç¹ûÓÃSAX£¬ËäÈ»¿ÉÒÔÖªµÀµ±Ç°½âÎöµÄÄÚÈÝ£¬µ«Í¨³£²»ÄÜÈ·¶¨»¹ÓжàÉÙÄÚÈÝÐèÒª½âÎö¡£ÔÚÕâЩ³¡ºÏ£¬ÈÎÎñµÄÖ´Ðнø¶ÈÖ»ÄÜ¿¿¹À¼ÆµÃµ½¡£

¡¡¡¡¹À¼ÆÒ»¸öÈÎÎñÐèÒª¶àÉÙÖ´ÐÐʱ¼äͨ³£ÊǺÜÀ§Äѵģ¬ÒòΪËüÉæ¼°µ½Ðí¶àÒòËØ£¬¼´Ê¹ÓÃʵ¼Ê²âÊԵİ취ҲÎÞ·¨µÃµ½¿É¿¿µÄ½áÂÛ£¬ÒòΪ·þÎñÆ÷µÄ¸ºÔØËæʱ¶¼Ôڱ仯֮ÖС£Ò»ÖÖ¼òµ¥µÄ°ì·¨ÊDzâÁ¿ÈÎÎñÿ´ÎÖ´ÐÐËùÐèʱ¼ä£¬È»ºó¸ù¾Ý×îºó¼¸´ÎÖ´ÐеÄƽ¾ùʱ¼ä¹ÀËã¡£Èç¹ûÒªÌá¸ß¹À¼Æʱ¼äµÄ¾«È·¶È£¬Ó¦µ±¿¼ÂÇʵÏÖÒ»ÖÖÕë¶ÔÓ¦ÓÃÌصãµÄËã·¨£¬×ۺϿ¼ÂǶàÖÖÒòËØ£¬ÀýÈçÒªÖ´ÐеÄSQLÓï¾äÀàÐÍ¡¢Òª½âÎöµÄXMLģʽµÄ¸´Ôӳ̶ȣ¬µÈµÈ¡£

¡¡¡¡½áÊøÓ±¾ÎÄÀý×ÓÏÔʾ³öÓÃJSP¡¢Java¡¢HTMLºÍJavaScript¹¹Ôì½ø¶ÈÌõÊÇÏ൱ÈÝÒ׵ģ¬ÕæÕýÀ§ÄѵÄÊÇÈçºÎ½«ËüÓõ½Êµ¼ÊÓ¦ÓÃÖ®ÖУ¬ÌرðÊÇ»ñµÃºǫ́ÈÎÎñµÄ½ø¶ÈÐÅÏ¢£¬µ«Õâ¸öÎÊÌâûÓÐͨÓõĴ𰸣¬Ã¿Ò»ÖÖºǫִ́ÐеÄÈÎÎñ¶¼ÓÐËü×Ô¼ºµÄÌص㣬±ØÐë°´ÕÕ¾ßÌåÇé¿ö¾ßÌå·ÖÎö¡£

¡¾·µ»Ø¶¥²¿¡¿ ¡¾´òÓ¡±¾Ò³¡¿ ¡¾¹Ø±Õ´°¿Ú¡¿

¹ØÓÚÎÒÃÇ / ¸øÎÒÁôÑÔ / °æȨ¾Ù±¨ / Òâ¼û½¨Òé / ÍøÕ¾±à³ÌQQȺ   
Copyright ©2003- 2024 Lihuasoft.net webmaster(at)lihuasoft.net ¼ÓÔØʱ¼ä 0.00177