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

ASPÓëJSPµÄ±È½Ï

ASPÓëJSPµÄ±È½Ï
´Ó΢ÈíÍƳöÁËASP(ActiveServerPage)ºó£¬ËüÒÔÆäÇ¿´óµÄ¹¦ÄÜ£¬¼òµ¥Ò×ѧµÄÌصã¶øÊܵ½¹ã´óWEB¿ª·¢ÈËÔ±µÄϲ»¶¡£µ«ÊÇËüÈ´ÓÐ΢Èí²úÆ·µÄͨ²¡,Ö»ÄÜÔÚWindowsƽ̨ÏÂʹÓã¬ËäÈ»Ëü¿ÉÒÔͨ¹ýÔö¼Ó¿Ø¼þ¶øÔÚLINUXÏÂʹÓ㬵«ÊÇÆ书ÄÜ×îÇ¿´óµÄDCOM¿Ø¼þÈ´²»ÄÜʹÓ᣶øSUN¹«Ë¾ÔÚJAVAµÄ»ù´¡Ï¿ª·¢³öµÄJSP(Java ServerPages)ʵÏÖÁ˶¯Ì¬Ò³ÃæÓ뾲̬ҳÃæµÄ·ÖÀ룬ÍÑÀëÁËÓ²¼þƽ̨µÄÊø¸¿£¬ÒÔ¼°±àÒëºóÔËÐеȷ½Ê½´ó´óÌá¸ßÁËÆäÖ´ÐÐЧÂʶøÖð½¥³ÉΪÒòÌØÍøÉϵÄÖ÷Á÷¿ª·¢¹¤¾ß¡£ÎªÁËʹÓùã´óÓ¦ÓÃASPµÄ³ÌÐòÔ±ÃÇÄܽü¿ìµÄѧ»áJSP¡£ÏÖ°ÑÆäÒìͬ¶Ô±ÈÈçÏ£º
Ò»¡¢½á¹¹
  JSPºÍASPÔڽṹÉÏÀàËÆ£¬¶¼ÊÇÒÔ“”×÷Ϊ±ê¼Æ·û£¬²»Í¬µÄÊÇÔÚ±ê¼Æ·ûÖ®¼äµÄ´úÂëASPΪJavaScript»òVBScript½Å±¾£¬¶øJSPΪJAVA´úÂë¡£JSP½«ÍøÒ³µÄ±íÏÖÐÎʽºÍ·þÎñÆ÷¶ËµÄ´úÂëÂß¼­·Ö¿ª¡£×÷Ϊ·þÎñÆ÷½ø³ÌµÄJSPÒ³Ã棬Ê×Ïȱ»×ª»»³Éservlet£¨Ò»ÖÖ·þÎñÆ÷¶ËÔËÐеÄjava³ÌÐò£©¡£ServletÖ§³ÖHTTPЭÒéµÄÇëÇóºÍÏìÓ¦¡£µ±JSP±»×ª»»³É´¿JAVA´úÂë¡£¶à¸öÓû§Í¬Ê±ÇëÇóÒ»¸öjspÒ³Ãæʱ£¬Ó¦ÓÃʵÀý»¯Ïß³ÌÀ´ÏìÓ¦ÇëÇó¡£ÕâЩÏß³ÌÓÉWEB·þÎñÆ÷½ø³ÌÀ´¹ÜÀí£¬ºÍASPµÄÏ̹߳ÜÀíÆ÷¹¦ÄÜÀàËÆ¡£Í¬CGIΪÿ¸öÇëÇó´´½¨Ò»¸ö½ø³ÌµÄģʽ±È½Ï£¬ÕâÖÖ·½Ê½Ð§ÂʸߵĶࡣ
¶þ¡¢ÐÔÄܺÍƽ̨ÎÞ¹ØÐÔ
  ÓëC++¡¢VBµÈÓïÑԱȽϣ¬JAVA±»¿´×÷ÊǸöЧÂʲ»Ì«¸ßµÄÓïÑÔ£¬µ«ËüÒÔÎþÉüЧÂÊ»»À´ÁËƽ̨ÎÞ¹ØÐÔʹJAVA¿ÉÒÔÔÚ´ó¶àÊý²Ù×÷ϵͳÉÏÔËÐжø²»ÐèÒªÖØбàÒë--Ðí¶àÈËÔ¸ÒâΪ´Ë¶ø¸¶³ö´ú¼Û¡£JAVAµÄ±àÒë´úÂëÊÇÒ»ÖÖ×Ö½Ú´úÂ룬ÔÚÔËÐÐʱÓɲÙ×÷ϵͳÉϵÄÒ»¸öJava VirtualMachine(JVM)ÐéÄâ»ú½âÊÍ¡£×Ö½Ú´úÂë¿ÉÒÔÔÚËùÓÐƽ̨ÉÏǨÒÆ£¬¶ø²»ÐèÒªÈκθĶ¯¡£½»²æƽ̨±à³ÌÇãÏòÓÚ²ÉÓÃËùÓвÙ×÷ϵͳµÄ“×îС¹«·Öĸ“£¬ÓÈÆäÊÇʹÓÃͼÐλ¯½çÃæʱ(servlets²»ÐèÒªÈκÎͼÐνçÃæ)¡£Servlets±È´«Í³µÄjava³ÌÐò£¨applets, javaapp£©Òª¿ì£¬ÒòΪËüÃÇÔÚ·þÎñÆ÷¶ËÔËÐУ¬²»ÐèÒª¼ÓÔسÁÖصÄGUI£¨HTMLµÄGUIÊǷdz£Éٵģ©¡£ÁíÍ⣬servletsµÄ×Ö½Ú´úÂëÖ»ÓÐÔÚ¿Í»§ÇëÇóʱ²ÅÖ´ÐУ¬ËùÒÔ¾¡¹Üµ±Ê״ε÷ÓÃservletsʱ»áÓм¸ÃëÖӵļÓÔØʱ¼ä£¬µ«ºóÐøµÄÇëÇóÏàÓ¦·Ç³£Ñ¸ËÙ£¬ÒòΪ·þÎñÆ÷ÒѾ­»º´æÁËÔËÐеÄservlets¡£µ±Ç°µÄjsp·þÎñÆ÷£¬¶¼´øÓÐjava ¼´Ê±±àÒëÆ÷£¨JIT£©£¬Òò´Ë£¬JSPµÄÖ´ÐбÈÿ´Î¶¼Òª½âÊÍÖ´ÐеÄASP´úÂëÒª¿ì£¬ÓÈÆäÊÇÔÚ´úÂëÖдæÔÚÑ­»·²Ù×÷ʱ£¬JSPµÄËÙ¶ÈÒª¿ì1µ½2¸öÊýÁ¿¼¶¡£
Èý¡¢Session¹ÜÀí
  ΪÁ˸ú×ÙÓû§µÄ²Ù×÷״̬£¬ASPÓ¦ÓÃSESSION¶ÔÏó¡£JSPʹÓÃÒ»¸ö½ÐHttpSessionµÄ¶ÔÏóʵÏÖͬÑùµÄ¹¦ÄÜ¡£SessionµÄÐÅÏ¢±£´æÔ


Ïà¹ØÎĵµ£º

Tomcat±àÒëjspÉú³ÉServletÎļþµÄ´æ·ÅλÖÃ

Tomcat½«jsp±àÒë³ÉservletºóµÄÎļþ´æ·ÅÔÚ\work\CatalinaĿ¼Ï£¬ÀýÈçjspÎļþ\webapps\hh\h.jsp£¬±àÒëºó
\work\Catalina\localhost\hh\org\apache\jsp\h_jsp.java
servletÎļþºÍ.classÎļþ¶¼ÔÚͬһĿ¼Ï¡£
     ¿ØÖÆ̨±¨µÄÒì³£ÐÐÊýÊÇÖ¸±àÒë¹ýºóµÄservletÎļþ,¶ø²»ÊÇÄãÔ­À´µÄjspÎļþ£¡ ......

JSPÖеÄÏà¶Ô·¾¶ºÍ¾ø¶Ô·¾¶

1.Ê×ÏÈÃ÷È·Á½¸ö¸ÅÄ
·þÎñÆ÷·¾¶£ºÐÎÈ磺http://192.168.0.1/µÄ·¾¶
WebÓ¦Ó÷¾¶£ºÐÎÈ磺http://192.168.0.1/yourwebappµÄ·¾¶
2.¹ØÓÚÏà¶Ô·¾¶Óë¾ø¶Ô·¾¶µÄÃèÊö£º
 ServletÖУ¬"/"´ú±íWebÓ¦ÓõĸúĿ¼¡£ºÍÎïÀí·¾¶µÄÏà¶Ô±íʾ¡£ÀýÈ磺"./" ´ú±íµ±Ç°Ä¿Â¼, "../"´ú±íÉϼ¶Ä¿Â¼¡£ÕâÖÖÀàËƵıíʾ£¬Ò²ÊÇÊôÓÚÏà¶Ô·¾¶¡£Õâ ......

JSPÖеÄÖÐÎÄÂÒÂëÎÊÌâ

ͨ¹ýrequest.getParameter(String name)·½Ê½È¡²ÎÊýnameÖеÄֵʱ£¬ÈçºÎ½â¾öÖÐÎÄÂÒÂëÎÊÌâ
·½·¨Ò»£ºÔÚËùÓеÄÈ¡ÖµÓï¾ä֮ǰÉèÖÃrequestµÄ±àÂ뷽ʽ£¬¼´request.setCharacterEncoding("utf-8") //utf-8Ò²¿ÉÒÔΪgb2312
            Ç°ÌáÌõ¼þÊÇ£º²ÎÊýnameËùÔÚµÄÒ³ÃæºÍ»ñÈ¡ ......

JSP/ServletÖеıàÂëÏà¹ØÉèÖÃ

ÔÚJSPºÍServletÖÐÓм¸¸öµØ·½¶¼¿ÉÒÔÉèÖñàÂ룬¸÷¸ö±àÂëµÄ¹¦ÄÜÒ²²»Ò»Ñù£¬±¾ÎĽ«¶Ô¸÷¸ö±àÂë×öÒ»¸öС½á¡£
¸÷ÖÖ±àÂëÒ»ÀÀ
A. JSP/Servlet¶¼ÓеıàÂëÉèÖÃ
1. request.setCharacterEncoding("UTF-8")
2. response.setCharacterEncoding("UTF-8")
3. response.setContentType("text/html;
charset=U ......

ASPµÄÄÇЩ¶«Î÷£¨Ò»£©

¿Í»§¶Ë½Å±¾£º<script language="scriptlanguage"></script>
·þÎñÆ÷¶Ë½Å±¾£º<% ......%>
VbscriptÊÇvisual basicµÄÒ»¸ö×Ó¼¯£¬ËäÈ»ÏÞÖÆÁË¿ÉÒÔʹÓõÄÄÚÖú¯ÊýµÄÊýÁ¿£¬µ«ÊÇҲʹµÃËû·Ç³£Ð¡ÇÉ£¬´Ó¶øÌá¸ßÁË¿ÉÒÆÖ²ÐÔ
VariantÊÇvbscriptµÄΨһÊý¾ÝÀàÐÍ£¬ÓÐ13ÖÖ×ÓÀàÐÍ£º
Empty,Null,Boolean,Byte,Integer,Curre ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ