JSPÓëASP.NET¼òµ¥Ö®±È½Ï!
JSPͬÑùÊÇʵÏÖ¶¯Ì¬ÍøÒ³µÄÒ»¸öÀûÆ÷¡£ÓÉÓÚËûµÄ½Å±¾ÓïÑÔÊÇJAVA£¬ËùÒԼ̳ÐÁËJAVAÖî¶àÓŵ㡣ÄÇôÓëASPÏà±È£¬Ó¦¸Ã¿ÉÒÔ˵ASPºÍJSP»ù±¾²»ÊÇÒ»¸öµµ´ÎÉϵġ£ÄÇôASP.NETºÍJAVAÈ´ÊÇ¿ÉÒÔ¿¹ºâµÄ¡£
JSPºÍASPÏà±È½Ï£º ÔËÐÐËٶȡ¢ÔËÐпªÏú¡¢ÔËÐÐƽ̨¡¢À©Õ¹ÐÔ¡¢°²È«ÐÔ¡¢º¯ÊýÖ§³Ö¡¢³§ÉÌÖ§³Ö¡¢¶ÔXMLµÄÖ§³ÖµÈµÈ£¬ASP¶¼²»ÊÇJSPµÄ¶ÔÊÖ¡£COM×é¼þµÄ¸´ÔÓÐÔʵ±à³ÌʵÏÖÓÐÒ»¶¨µÄÄѶȡ£¶øJAVABeansºÍJAVAµÄ½áºÏÈ´ÊÇÌìÒÂÎÞ·ìµÄ¡£
JSPºÍASP.NETÏà±È½Ï£º
1£®Ïà¶ÔC£££¬JSPµÄ½Å±¾ÓïÑÔJAVAÒ²ÊÇÃæÏò¶ÔÏóµÄ¡¢·Ö²¼Ê½µÄ¡¢½âÊ͵ÄÓïÑÔ¡£
2£®ÓëC££ÏàËÆJAVAͬÑùÈ¥µôÁËÄÑÒÔÀí½âµÄÖ¸ÕëµÈ¸ÅÄȡ¶ø´úÖ®µÄÊÇÀàºÍ¶ÔÏó¡£
3. JSPÓÐÒ»Ïîȫеļ¼Êõ¨D¨DServlet£¨·þÎñÆ÷¶Ë³ÌÐò£©ºÜºÃµÄ½ÚÔ¼ ÁË·þÎñÆ÷×ÊÔ´¡£
4£®JAVABeansÊÇÕë¶ÔASP.NETµÄServer ControlµÄ¼¼Êõ¡£Ö»Òª »áJAVA£¬ JavaBeans¾ÍºÜÈÝÒ×д³ö¡£
5£®ÔÙÓоÍÊÇJAVAµÄJDBCÊý¾Ý¿âÁ¬½Ó¼¼Êõ¡£
6£®JSP¶ÔXMLͬÑùÓÐÊ®·Ö¹ã·ºµÄÖ§³Ö¡£
1) ÃæÏò¶ÔÏóÐÔ: ASP+½«C#×÷ΪһÖÖÃæÏò¶ÔÏóÓïÑÔ£¬Ôںܶ෽ÃæÀ´¿´£¬C#½«³ÉΪ΢ÈíµÄÓëJavaÏàËƵÄÓïÑÔ¡£ C#ÁíÒ»¸öÓÐȤµÄµØ·½ÊÇËùÓжÔÏó¶¼×Ô¶¯±ä³ÉΪCOM¶ÔÏó¡£Èç¹ûC#ÄÜÈ¡µÃºÜ´óµÄÊг¡·Ý¶î£¬ÄÇôËü½«¸øASP+´øÀ´ÀàËÆÓÚJavaµÄ¹¦ÄÜ£¬²¢ÇҾ߱¸¸ü¿ìµÄÐÔÄÜ£¬ÒòΪËü¿ÉÒÔºÍWindows»·¾³½ôÃܼ¯³É¡£ C# ÊÇASP+¿ª·¢ÖÐÒ»¸ö×îÖØÒªµÄ¹¦ÄÜ£¬Î¢Èí»á½«C#·¢Õ¹³ÉΪJavaµÄÇ¿¾¢¶ÔÊÖ¡£ÕâÒ²ÊÇËûÃÇ.Net¿ò¼ÜµÄÒ»¸öÖØÒª×é³É²¿·Ö¡£ÎÒÈÏΪC#ÊÇ΢ÈíÔÚ±à³ÌÊг¡ÉÏ»÷°Ü¶ÔÊÖµÄÖ÷Òª¹¤¾ß¡£ÎÒÆÚ´ý×Å΢ÈíÄÜÔÚÕâ¸ö²úÆ·ºóÃæÇãעȫÁ¦£¬ÕâÑù£¬C#¿ÉÒÔ³ÉΪÐí¶à³ÌÐòÔ±µÄÓÖÒ»ÖÖÑ¡Ôñ¡£C#²úÉúµÄ½á¹ûÊǽ«½øÒ»²½¼Ó¹Ì΢ÈíºÍSun²úÆ·µÄÕ½Ïß¡£Õâ¶ÔÓû§ÊÇÓÐÀûµÄ£¬ËûÃÇ¿ÉÒÔÑ¡ÔñÁ½ÕßÖ®Ò»À´¿ª·¢ÐµÄÓ¦Óᣠ2) Êý¾Ý¿âÁ¬½Ó£º ASPÁíÒ»¸öÁÁµãÊÇËüʹÓÃADO¶ÔÏó£¬ODBC, OLE-DBºÍÊÂÎñ´¦Àí¹ÜÀíÆ÷¡£Òò´ËASP WebÊý¾Ý¿âÓ¦Óÿª·¢Ìرð¼òµ¥¡£ASP+·¢Õ¹Á˸ü¶àµÄ¹¦ÄÜ£¬ÒòΪÓÐÁËADO+£¡ADO+´øÀ´Á˸üÇ¿´ó¸ü¿ìËٵŦÄÜ¡£JSPºÍJDBCÄ¿Ç°ÔÚÒ×ÓÃÐÔºÍÐÔÄÜÉÏͬASP/ADOÏà±ÈÒÑÓÐЩÂäºó£¬µ±Ð°汾ASP+/ADO+³öÏÖºóÕâÑùµÄ²î±ð»á¸üÃ÷ÏÔ¡£ÎÒ¸öÈËÏ£ÍûSUNÓ¦¾¡¿ìÄÜ»¨´óÁ¦ÆøÀ´×·¸ÏASP+/ADO+µÄ×éºÏ¡£
3) ´óÐÍÕ¾µãÓ¦Ó㺠ASP+½«¶Ô´óÐÍÕ¾µã(web farms)ÓиüºÃµÄÖ§³Ö¡£ÊÂʵÉÏ£¬Î¢ÈíÔÚÕâ·½Ã渶³öÁ˾޴óµÄŬÁ¦¡£ ASP+¿ÉÒÔÈÃÄ㿼Âǵ½¶à·þÎñÆ÷(multiple servers)µÄ³¡ºÏ£¬µ±ÄãÐèÒª¸üÇ¿´óµÄ¹¦ÄÜʱ£¬½ö½öÖ»ÐèÒªÔö¼Óһ̨·þÎñÆ÷¡£Õû¸ö.Net¿ò¼ÜÒѾ³ä·ÖµØÌṩÁËÕâ¸ö·½·¨¡£ASP+ÌṩÁËÍⲿ»á»°×´Ì¬(externa
Ïà¹ØÎĵµ£º
Ðí¾ÃûÓеǼ×Ô¼ºµÄУÄÚÍøÁË£¬½ñÌìµÇ¼ÁËһϣ¬ºöÈ»·¢ÏÖУÄÚµÄÉÏ´«ÕÕƬͦÓÐÒâ˼µÄ£¬ÓÚÊǺõ¾Í´ÓÍøÉÏÕÒÁËһϣ¬Ð£ÄÚÓ¦¸ÃÊÇʹÓÃjspдµÄ¡£ÔÚÍøÉÏÕÒµ½Á˸öFileUpload¿Ø¼þ£¬¿ÉÒԺܷ½±ãµÄÉÏ´«Îļþ¡£ÔÚÍøÉÏÕÒµ½Ò»ÆªÏêϸ½éÉÜÕâ¸ö¿Ø¼þʹÓõģ¬ÊÔÑéÁËһϣ¬¸ãÁ˺þòÅʵÏÖÏÖÔÚÕûÀí³öÀ´¡£
Ò»¡¢Ê× ......
<%
Cookie[] cooks = request.getCookies();
String cookieName = "Mycookie";
boolean flag = false;
for(Cookie cook : cooks)
{
if(cook.getName().equals(cookieName))
{
flag = true;
break;
}
}
if(!flag){
String str=System.currentTimeMillis()+"";
Cook ......
Óö¼û¹ýÕâÑùµÄÎÊÌ⣬ºÜÆæ¹Ö£¬¾ÍÊÇ asp.net button°´Å¥onclickʼþ´¥·¢²»ÁË£¬
µã»÷û·´Ó¦£¬È»ºóÔÚÍøÉϲéÁËЩ×ÊÁÏ£¬·¢ÏÖÒ»¸ö˵·¨£¬“Ò»°ãÀ´ËµÊÇ¿Í»§¶ËÔ´´úÂëÖÐÓжà¸öform±êʶ£¬»á³öÏÖÕâÖÖÇé¿ö”
ÓÚÊǾͲ鿴×Ô¼ºµÄÒ³Ãæ´úÂ룬ÕæµÄÓÐÁ½¸öform£¬È¥µôÒ»¸öºó£¬¾ÍÕý³£À²£¬
ÖÁÓÚ ÕâÖÖÇé¿ö£¬Ôڴ˼ÇÏÂÀ´£¬×÷¸öѧϰµÄÒ»¸öÐ¡Ö ......
Ò»¡¢ÓÃJQueryµÄAjax¼ÓÔØXML²¢½âÎöµÄ×¢ÒâÊÂÏî
1¡¢Content-Type
ºÜ¶àʱºòÎÞ·¨½âÎö¾ÍÊÇContent-TypeµÄÎÊÌâ¡£Èç¹û±¾Éí¾ÍÊÇXMLÎļþ£¬ÇëÌø¹ýÕâÒ»²½¡£
¶¯Ì¬Éú³ÉµÄXMLÒ»¶¨Òª½«ÆäÉèÖÃΪtext/xml£¬·ñÔòĬÈϾÍÊÇtext/htmlÒ²¾ÍÊÇÆÕͨµÄÎı¾¡£ ³£¼ûÓïÑÔµÄContent-TypeÉèÖãº
  ......
ASP.NET Êý¾Ý¿Ø¼þ:GridView,DataList,Repeater ,DetailsView,FormView¡£
ASP.NET Êý¾Ý¿Ø¼þ×ÛÊö£º
1.Ç°3¸öÓÃÓÚ³ÊÏÖ¶àÌõ¼Ç¼,ºóÃæ2¸öÓÃÓÚ³ÊÏÖµ¥ÌõÊý¾ÝÃ÷ϸ,¼´³£ÓõļǼÃ÷ϸ¡£
2.GridViewºÍDetailsView¿Ø¼þµÄ²¼¾Ö¹Ì¶¨,×Ô¶¨ÒåÊý¾ÝÏÔʾµÄ²¼¾Ö¹¦ÄÜÓÐÏÞ,Ò»°ãÊʺϲ¼¾Ö¼òµ¥µÄÊý¾Ý³ÊÏÖ¡£
3.DataList,RepeaterºÍFormViewÊý¾Ý ......