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

ÈçºÎtomcatÏÂÅäÖÃjsp¡¢servletºÍben

¾­³£¿´µ½jspµÄ³õѧÕßÎÊtomcatÏÂÈçºÎÅäÖÃjsp¡¢servletºÍbeanµÄÎÊÌ⣬ÓÚÊÇ×ܽáÁËÒ»ÏÂÈçºÎtomcatÏÂÅäÖÃjsp¡¢servletºÍben£¬Ï£Íû¶ÔÄÇЩ³õѧÕßÓÐËù°ïÖú¡£ µÚÒ»²½£ºÏÂÔØj2sdkºÍtomcat£ºµ½sun¹Ù·½Õ¾µã£¨http: //java.sun.com/j2se/1.4.2/download.html£©ÏÂÔØj2sdk£¬×¢ÒâÏÂÔØ°æ±¾Îª Windows Offline InstallationµÄSDK£¬Í¬Ê±×îºÃÏÂÔØJ2SE 1.4.2 Documentation£¬È»ºóµ½ tomcat¹Ù·½Õ¾µã£¨http://www.apache.org/dist/jakarta/tomcat-4/£©ÏÂÔØtomcat£¨ÏÂÔØ×îР4.1.x°æ±¾µÄtomcat£©£» µÚ¶þ²½£º°²×°ºÍÅäÖÃÄãµÄj2sdkºÍtomcat£ºÖ´ÐÐj2sdkºÍtomcatµÄ°²×°³ÌÐò£¬È»ºó°´Ä¬ÈÏÉèÖýøÐа²×°¼´¿É¡£ 1.°²×°j2sdkÒÔºó£¬ÐèÒªÅäÖÃһϻ·¾³±äÁ¿£¬ÔÚÎҵĵçÄÔ->;ÊôÐÔ->;¸ß¼¶->;»·¾³±äÁ¿->;ϵͳ±äÁ¿ÖÐÌí¼ÓÒÔÏ»·¾³±äÁ¿(¼Ù¶¨ÄãµÄj2sdk°²×°ÔÚc:\j2sdk1.4.2£©£º JAVA_HOME=c:\j2sdk1.4.2 classpath=.;%JAVA_HOME%\lib\dt.jar;%JAVA_HOME%\lib\tools.jar;£¨.;Ò»¶¨²»ÄÜÉÙ£¬ÒòΪËü´ú±íµ±Ç°Â·¾¶) path=%JAVA_HOME%\bin ½Ó×Å¿ÉÒÔдһ¸ö¼òµ¥µÄjava³ÌÐòÀ´²âÊÔJ2SDKÊÇ·ñÒѰ²×°³É¹¦£º public class Test{ public static void main(String args[]){ System.out.println("This is a test program."); } } ½«ÉÏÃæµÄÕâ¶Î³ÌÐò±£´æÎªÎļþÃûΪTest.javaµÄÎļþ¡£ È»ºó´ò¿ªÃüÁîÌáʾ·û´°¿Ú£¬cdµ½ÄãµÄTest.javaËùÔÚĿ¼£¬È»ºó¼üÈëÏÂÃæµÄÃüÁî javac Test.java java Test ´ËʱÈç¹û¿´µ½´òÓ¡³öÀ´This is a test program.µÄ»°ËµÃ÷°²×°³É¹¦ÁË£¬Èç¹ûûÓдòÓ¡³öÕâ¾ä»°£¬ÄãÐèÒª×Ðϸ¼ì²éÒ»ÏÂÄãµÄÅäÖÃÇé¿ö¡£ 2.°²×°Tomcatºó£¬ÔÚÎҵĵçÄÔ->;ÊôÐÔ->;¸ß¼¶->;»·¾³±äÁ¿->;ϵͳ±äÁ¿ÖÐÌí¼ÓÒÔÏ»·¾³±äÁ¿(¼Ù¶¨ÄãµÄtomcat°²×°ÔÚc:\tomcat£©£º CATALINA_HOME=c:\tomcat; CATALINA_BASE=c:\tomcat; È»ºóÐ޸Ļ·¾³±äÁ¿ÖеÄclasspath£¬°Ñtomat°²×°Ä¿Â¼ÏµÄcommon\libϵÄservlet.jar×·¼Óµ½classpathÖÐÈ¥£¬Ð޸ĺóµÄclasspathÈçÏ£º classpath=.;%JAVA_HOME%\lib\dt.jar;%JAVA_HOME%\lib\tools.jar;%CATALINA_HOME%\common\lib\servlet.jar; ½Ó×Å¿ÉÒÔÆô¶¯tomcat£¬ÔÚIEÖзÃÎÊhttp://localhost:8080£¬Èç¹û¿´µ½tomcatµÄ»¶Ó­Ò³ÃæµÄ»°ËµÃ÷°²×°³É¹¦ÁË¡£ µÚÈý²½£º½¨Á¢×Ô¼ºµÄjsp appĿ¼ 1.µ½TomcatµÄ°²×°Ä¿Â¼µÄwebappsĿ¼£¬¿ÉÒÔ¿´µ½ROOT£¬examples, tomcat-docsÖ®ÀàTomcat×Ô´øµÄµÄĿ¼£» 2.ÔÚwebappsĿ¼ÏÂн¨Ò»¸öĿ¼£¬ÆðÃû½Ðmyapp£» 3.myappÏÂн¨Ò»¸öĿ¼WEB-INF£¬×¢Ò⣬Ŀ¼Ãû³ÆÊÇÇø·Ö´óСдµÄ£» 4.WEB-INFÏÂн¨Ò


Ïà¹ØÎĵµ£º

JSPÈçºÎÉèÖÃCookieºÍɾ³ýCookie

ºÜ¶àÀýÈçµÇ¼»òÕß×¢ÏúµÇ¼µÄµØ·½ÐèҪʹÓõ½Cookie£¬½ñÌìѧµ½ÔÚJSPÖÐÈçºÎ²Ù×÷Cookie·ÖÏíÏÂ
4.CookieÀà³£Óõķ½·¨
1.setValue()/getValue() —>»ñÈ¡cookie¶ÔÏóµÄÖµ¡£
2.getName()—>»ñÈ¡cookie¶ÔÏóµÄÃû³Æ£¬Ñ­»·µÄʱºò¿ÉÒÔÓÐÑ¡ÔñµÄʹÓÃCookie
3.setMaxAge()/getMaxAge()—>ÉèÖûò»ñÈ¡cookie¶ÔÏóÓÐ ......

jsp±Ê¼Ç

½ñÌìÖØÐÂÕûÀíµçÄÔ£¬ÕÒµ½Ò»¸öÎļþ£¬¿´ÁËÏÂÈÕÆÚ£¨2006.10.21£© £¬Å²»Ð¡ÐÄÔÙ¶ªÁË£¬´æµ½ÍøÉÏÀ´É¹É¹¡£ 
0»ò1¸öpackage  É趨ÀàËùÔÚ°ü
0»ò¶à¸öimport  µ¼Èë±ØÒªÀà
script     ÊÖ¸å, ÊÖ¼£, ¾ç±¾, ¿¼ÉúµÄ±ÊÊÔ¾í, Ô­±¾
alert      v.Ìá·ÀµÄ, ¾¯ÌèµÄ n.¾¯Ìè, ......

windowsÏÂÅäÖÃJSP¿ª·¢»·¾³

 Ò»¡¢°²×°JDK
¡¡¡¡Ê×ÏÈÏÂÔØJDK 5.0£¨JDK 5.0µÄÏÂÔØÒ³ÃæÎª£ºhttp://java.sun.com/j2se/1.5.0/download.jsp£©£» È»ºóÔËÐÐJDK 5.0°²×°³ÌÐòjdk-1_5_0_06-windows-i586-p.exe£¬°²×°¹ý³ÌÖÐËùÓÐÑ¡Ïî±£³ÖĬÈÏ£»×îºóÅäÖÃJDKµÄ»·¾³±äÁ¿£ºÔÚ“ÎҵĵçÄÔ”ÉϵãÓÒ¼ü—>“ÊôÐÔ”—>“¸ß¼¶& ......

11.11 JSP/Servlet¿ª·¢µÄһЩ½¨Òé


²»ÒªÔÚJSPÖд¦ÀíÓû§ÇëÇó£¨request£©£¬Ò²²»ÒªÔÚJSPÖÐǶÈë¿ØÖÆÁ÷´úÂë
²»Òª½«Óû§½çÃæ²¿·ÖºÍÒµÎñÂß¼­²¿·Ö»ìºÏ
ÔÚJSPÖо¡Á¿²»Òª°üº¬java´úÂ룬ELÔÚÕâ·½Ãæ¿ÉÒÔ¸øÎÒÃǺܴó°ïÖú
½«Ò³Ãæ·ÖΪ¼¸¸ö²¿·Ö£ºHeader£¬Menu£¬Main¡£¡£¡£
......

jspÖÐÎÄÂÒÂëÎÊÌâ

 ½â¾ö°ì·¨£º  
µÚÒ»£º  
 1:ÔÚjspÒ³Ãæ¼ÓÈ룺  
<%@  page  contentType="text/html;  charset=gb2312"  %>  
 2:ÔÚservletÀïÃæ:  
   public  void  doGet(HttpServletRequest  request,  HttpServletResponse &nbs ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØÍ¼ | ¸ÓICP±¸09004571ºÅ