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

jsp ÑéÖ¤

³¤¶ÈÏÞÖÆJavaScript´úÂë
CODE:
<script> function test() { if(document.a.b.value.length>50) { alert("²»Äܳ¬¹ý50¸ö×Ö·û£¡"); document.a.b.focus(); return
false; } } </script> <form. name=a nsubmit="return test()"> <textarea name="b" cols="40" wrap="VIRTUAL" rows="6"></textarea> <input type="submit" name="Submit" value="check">
</form>2. Ö»ÄÜÊǺº×Ö
JavaScript´úÂë
CODE:
<input nkeyup="value="/oblog/value.replace(/[^\u4E00-\u9FA5]/g,'')">3." Ö»ÄÜÊÇÓ¢ÎÄ
JavaScript´úÂë
CODE:
<script. language=javascript> function onlyEng() { if(!(event.keyCode>=65&&event.keyCode<=90)) event.returnvalue=false; } </script>
<input nkeydown="onlyEng();">4. Ö»ÄÜÊÇÊý×Ö
JavaScript´úÂë
CODE:
<script. language=javascript> function onlyNum() { if(!((event.keyCode>=48&&event.keyCode<=57)||(event.keyCode>=96&&event.keyCode<=105))) //¿¼ÂÇС¼üÅÌÉϵÄÊý×Ö¼ü
event.returnvalue=false; } </script>
<input nkeydown="onlyNum();">5. Ö»ÄÜÊÇÓ¢ÎÄ×Ö·ûºÍÊý×Ö
6. ÑéÖ¤ÓÍÏä¸ñʽ
JavaScript´úÂë
CODE:
<SCRIPT. LANGUAGE=javascript. RUNAT=Server> function isEmail(strEmail) { if (strEmail.search(/^\w+((-\w+)|(\.\w+))*\@[A-Za-z0-9]+((\.|-)[A-Za-z0-9]+)*\.[A-Za-z0-9]+$/) != -1) return
true; else
alert("oh"); } </SCRIPT>
<input type=text nblur=isEmail(this.value)>7. ÆÁ±Î¹Ø¼ü×Ö(ÕâÀïÆÁ±Î***ºÍ****)
JavaScript´úÂë
CODE:
<script. language="javascript1.2"> function test() { if((a.b.value.indexOf ("***") == 0)||(a.b.value.indexOf ("****") == 0)){ alert(":)"); a.b.focus(); return
false;} } </script> <form. name=a nsubmit="return test()"> <input type=text name=b> <input type="submit" name="Submit" value="check"> </form> 8. Á½´ÎÊäÈëÃÜÂëÊÇ·ñÏàͬ
JavaScript´úÂë
CODE:
<FORM. METHOD=POST ACTION=""> <input type="password" id="input1"> <input type="password" id="input2"> <input type="button" value="test" ncli


Ïà¹ØÎĵµ£º

jsp·ÖÒ³

Ô´³ÌÐò
<%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 ......

jspÒ³ÃæÌøת·½·¨´óÈ«

JSPÖеÄÌøת£º
(1). forward()·½·¨
    ʹÓõ½javax.servlet.RequestDispatcherÀà
    RequestDispatcher rd = getServletContext().getRequestDispatcher("url");
    rd.forward(requestVar,requestVar); //´«µÝservletµÄÈë¿Ú²ÎÊý
    /*forwardº ......

Êý¾ÝÊäÈë¼°Êä³öÏÔʾ——JSPʵÓÃÀý×Ó

Àý×Ó˵Ã÷£ºÕâÀý×ÓÊÇѧÉú»ù±¾ÐÅÏ¢µÄÊäÈëÒÔ¼°Êä³öÏÔʾ;ÓÐÁ½¸öÒ³Ã棺info.jspºÍshowInfo.jsp£¬Ç°ÕßÊǹ˿ÍÊäÈëµÄÐÅÏ¢Ò³Ã棬¶øºóÕßÊÇ´¦ÀíÐÅÏ¢µÄÒ³Ãæ¡£
info.jsp
 <%@page contentType="text/html;charset=gb2312"%>
 <HTML>
    <HEAD>
    <TITLE>ÊäÈëѧ ......

¡¾JSPѧϰ±Ê¼Ç¡¿ JSP֪ʶµã×ܽá

Ò»¡¢JSPµÄ¼¼ÊõÔ­Àí
 
¶þ¡¢JSPµÄ×¢ÊͺÍÉùÃ÷
      JSP×¢ÊÍÓÃÓÚ±íÃ÷ÔÚ³ÌÐò¿ª·¢¹ý³ÌÖеĿª·¢Ìáʾ£¬²»»áÊä³öµ½¿Í»§¶Ë£»
      <%--×¢ÊÍÄÚÈÝ--%> —— JSP×¢ÊÍ
 
     <£¡--×¢ÊÍÄÚÈÝ--£¡>   —&md ......

JSPÂÒÂë´¦Àí´óÈ«

Ò»¡¢JSPÒ³ÃæÏÔʾÂÒÂë
¶þ¡¢±íµ¥Ìá½»ÖÐÎÄʱ³öÏÖÂÒÂë
Èý¡¢Êý¾Ý¿âÁ¬½Ó
´ó¼ÒÔÚJSPµÄ¿ª·¢¹ý³ÌÖУ¬¾­³£³öÏÖÖÐÎÄÂÒÂëµÄÎÊÌ⣬¿ÉÄÜÒ»ÖÁÀ§ÈÅ×ÅÄú£¬ÎÒÏÖÔÚ°ÑÎÒÔÚJSP¿ª·¢ÖÐÓöµ½
µÄÖÐÎÄÂÒÂëµÄÎÊÌâ¼°½â¾ö°ì·¨Ð´³öÀ´¹©´ó¼Ò²Î¿¼¡£
Ò»¡¢JSPÒ³ÃæÏÔʾÂÒÂë
ÏÂÃæµÄÏÔʾҳÃæ(display.jsp)¾Í³öÏÖÂÒÂ룺
<html>
<head>
<tit ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ