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

JSP»·¾³ÅäÖÃ

Ò») °²×°JDK(jdk-1_5_0-windows-i586.exe)£¬Ä¬ÈÏ°²×°£»
(¶þ) °²×°Tomcat(tomcat5.5-installer.exe)£¬Ä¬ÈÏ°²×°£»
 * ˳Ðò²»¿ÉÒԵߵ¹ *
(Èý) ²âÊÔ°²×°½á¹û
1. ´ò¿ªä¯ÀÀÆ÷ÊäÈëhttp://localhost:8080£¬Èç¹û³É¹¦£¬Ôò»á¿´µ½»¶Ó­Ò³Ãæ¡£´Ëʱ·ÃÎʵÄ·¾¶Îª$tomcat/webapps/root/
(ËÄ) ½¨Á¢ÎÒµÄÕ¾µã
·½·¨Ò»£ºÖ±½Ó½«$tomcat/webapps/root/×÷Ϊվµã£¬¿ªÊ¼ÖÆ×÷¡£
·½·¨¶þ£ºÔÚwebappsÖд´½¨
1. Ð½¨Îļþ¼Ð$tomcat/webapps/myjsp
2. ¿½±´$tomcat/webapps/root/WEB-INFÎļþ¼Ðµ½myjspÎļþ¼Ð
3. Ð½¨Îļþtest.jspµ½myjspÖÐ
4. ²âÊÔÎļþ£ºhttp://localhost:8080/myjsp/test.jsp
·½·¨Èý£ºÈÎÒâλÖô´½¨Õ¾µã£¨ÍƼö£©
1. ÈÎÒâλÖÃн¨Îļþ¼Ð£¬Èçd£º/myjsp
2. ¿½±´$tomcat/webapps/root/WEB-INFÎļþ¼Ðµ½myjspÎļþ¼Ð
3. Ð½¨Îļþtest.jspµ½myjspÖÐ
4. ´ò¿ª$tomcat/conf/server.xml£¬ÔÚµÚ192ÐÐ<Host name="localhost" appBase="webapps" unpackWARs="true" autoDeploy="true" xmlValidation="false" xmlNamespaceAware="false">ÏÂÃæÔö¼ÓÒ»¾ä£º <Context path="/anyword" docBase="d:/myjsp" /> *×¢Òâ´óСдContext,docBase*
5. ²âÊÔÎļþ£ºhttp://localhost:8080/anyword/test.jsp
(Îå) Tomcat°²×°Ä¿Â¼ËµÃ÷
1. bin Åú´¦ÀíÎļþ£¬Æô¶¯ÖÕֹʱµÄ»·¾³ÅäÖÃ
2. conf ÅäÖÃÎļþ£¬web.xmlºÍserver.xml
3. logs ÈÕÖ¾
4. webappsÓ¦ÓóÌÐòĿ¼
a) \root ĬÈÏÕ¾µãÆô¶¯Ä¿Â¼
b) \root\web-inf\web.xml Õ¾µãÅäÖÃÐÅÏ¢
5. work ´æ·Å.javaºÍ.class£¬²»Òª¸Ä¶¯
(Áù) ¸ü¸Ä¶Ë¿Ú
´ò¿ª$tomcat/conf/server.xml µÚ78ÐУ¬port="8080" ¸ü¸ÄΪ8888£¬ÖØÆôtomcat£¬ä¯ÀÀhttp://localhost:8888/anyword/test.jsp¡£
£¨Æߣ©¸ü¸ÄĬÈÏÆô¶¯Ò³Ã棺$tomcat/conf/web.xml×îºóλÖÃ
<welcome-file-list>
<welcome-file>index.html</welcome-file>
<welcome-file>index.htm</welcome-file>
<welcome-file>index.jsp</welcome-file>
</welcome-file-list>
¿ÉÒÔɾ³ýËùÓÐ<welcome-file>***</welcome-file>
£¨°Ë£©ÔÊÐíĿ¼ä¯ÀÀ£ºµ±»¶Ó­Ò³ÃæûÓÐÕÒµ½Ê±ÔÊÐíĿ¼ä¯ÀÀ£¬ÔòÐèÒª¸ü¸Ä$tomcat/conf/web.xmlµÚ80ÐÐlistingsµÄֵΪtrue¡££¨tomcat5.5ÐèÒª£¬4.1²»ÐèÒª£©


Ïà¹ØÎĵµ£º

jspͨ¹ýdivʵÏÖ¸²¸Ç£¬µ¯³öд°Ìå

<body style="height:100%;">
-------------------------------------------------------------------Ò»¿ªÊ¼µÄÒ³Ãæ----------------------
fdasfsdfadf
<input name="button2" onclick="ShopConfirm('fdsaf')" value="µãÎÒ" type="button"/>
--------------------------------------------------------- ......

jsp ÖÐÎÄÂÒÂë½â¾ö´óÈ«

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

ÌáÉýJSPÓ¦ÓóÌÐòµÄÆß´ó¾øÕÐ


Äãʱ³£±»¿Í»§±§Ô¹JSPÒ³ÃæÏìÓ¦ËٶȺÜÂýÂð£¿ÄãÏë¹ýµ±¿Í»§·ÃÎÊ´ÎÊý¾çÔöʱ£¬ÄãµÄWEBÓ¦ÓÃÄܳÐÊÜÈÕÒæÔö¼ÓµÄ·ÃÎÊÁ¿Âð£¿
      ±¾ÎĽ²ÊöÁ˵÷ÕûJSPºÍservletµÄһЩ·Ç³£ÊµÓõķ½·¨£¬Ëü¿ÉʹÄãµÄservletºÍJSPÒ³ÃæÏìÓ¦¸ü¿ì£¬À©Õ¹ÐÔ¸üÇ¿¡£¶øÇÒÔÚÓû§ÊýÔö¼ÓµÄÇé¿öÏ£¬ÏµÍ³¸ºÔØ»á³ÊÏÖ³öƽ»¬Éϳ¤µÄÇ÷ÊÆ¡£ÔÚ±¾ÎÄÖ ......

jspÎļþÏÂÔØÍêÕû·½·¨

µÚÒ»ÖÖ£º
¾ÍÊÇÖ±½Ó¸ø³öÏÂÔصĵØÖ·£¬ÕâÖÖ·½Ê½ºÜ²»ºÃ£¬ÒòΪ»á±©Â¶ÄãµÄµØÖ·£¬´øÀ´ºÜ¶à²»°²È«µÄÒòËØ£¬¿ÉÒÔ˵ÊÇǧÍò²»ÒªÓÃÕâÖÖ
µÚ¶þÖÖ£º
ÏÂÔØÒ³Ãæ
<%@ page language="java" import="java.util.*" pageEncoding="GB18030"%>
<html>
<head>
<title>download</title>
</head>
< ......

JSPÖÐÎļþÏÂÔØ

<%--   
 
ÓÐЩÅóÓÑѯÎÊʹÓà JSP Smart ÏÂÔØÎļþµÄʱºò±¨´í, ÕâÀï¸ø³öÒ»¸ö²âÊÔ¹ýµÄ²»  
 
ÐèҪʹÓà JSP Smart µÄ JSP Ò³ÃæÖнøÐÐÎļþÏÂÔصĴúÂë(¸Ä Servlet »òÕß  
 
JavaBean µÄ»°×Ô¼º¸Ä°É), Ö§³ÖÖÐÎĸ½¼þÃû(×öÁËתÄÚÂë´¦Àí). ÊÂʵÉÏÖ»ÒªÏò   ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ