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

ÎÒµÄJSPѧϰ±Ê¼Ç JSPÒ³ÃæÖеÄ×¢ÊÍ

JSPÒ³ÃæÖÐÒ»°ãÓÐÁ½Àà×¢ÊÍ
1.html×¢ÊÍ
ÐÎÈç<!--...................-->
Ëü»áͬhtml±ê¼Çһͬ·¢µ½¿Í»§¶Ë
2.jsp×¢ÊÍ£¨3ÖÖ£©
ÐÎÈç<%--.............................--%>
Ëü²»»á±»·¢Ë͵½¿Í»§¶Ë£¬Ö»ÓÃÀ´×¢ÊÍ·þÎñÆ÷¶ËµÄjspÎļþ£¬Á¬jspÉú³ÉµÄservletҲûÓÐ×¢ÊͽøÈ¥£¬ÕâÒ²ÊǴ󲿷ÖÈËʹÓõÄ×¢ÊÍ
ÐÎÈç<%//............................%>ºÍÐÎÈç<%/*................................................*/%>
ËüÊÇ·þÎñÆ÷¶ËµÄ×¢ÊÍ£¬µ«Êǻᱻת»¯³ÉjavaµÄ×¢ÊÍ£¨//................ºÍ/*........................*/£©²¢½«Æä²åÈëÏàÓ¦µÄjspÉú³ÉµÄservletµÄÏàӦλÖÃ


Ïà¹ØÎĵµ£º

jspºÍServlet¸÷×ÔÌصã

1. servletÊÇÔÚjavaÀïǶÌ×html,jspÊÇÔÚhtmlÀïÃæǶÌ×java,jspÐèÒªÏȱàÒë³Éservlet²ÅÄÜÖ´ÐÐ.
2. jsp×îÖÕ·­Òë³ÉservletÖ´ÐÐ.jspÈÝÒ×ÉÏÊֺͱàд¶øservletÐèÒª×Ô¼ºÊÖ¶¯±àÒë,ºÜÂé·³µÄ
3. servletÏÖÔÚ¸ü¶àÊdz䵱MVCÄ£ÐÍ¿ØÖÆÆ÷µÄ½ÇÉ«,ÓÉËü¸ù¾Ý¿Í»§µÄÇëÇó,À´¶¯Ì¬×éÖ¯·µ»ØÊý¾Ý»òÒ³ÃæµÄÖض¨Ïò,¶øJSPÖ»×öÏÔʾ(MVCÄ£ÐÍ,ÏÔʾ¿ØÖÆÄ£ÐÍ ÏÔ ......

jsp 301Öض¨ÏòµÄÒâÒ弰ʵÏÖ

 Ê×ÏÈ,˵һÏÂ301Öض¨ÏòµÄÒâÒåÓë×÷ÓÃ(ÍøÉÏÕÒµÄÏà¹Ø×ÊÁÏ)
ÆäʵÕâ¾ÍÉæ¼°µ½ÁËSEOµÄ֪ʶ¡£
ʲôÊÇ301תÏò£¿
´ÓËÑË÷ÒýÇæÓÅ»¯½Ç¶È³ö·¢£¬301Öض¨ÏòÊÇÍøÖ·Öض¨Ïò×îΪ¿ÉÐеÄÒ»ÖÖ°ì·¨¡£µ±ÍøÕ¾µÄÓòÃû·¢Éú±ä¸üºó£¬ËÑË÷ÒýÇæÖ»¶ÔÐÂÍøÖ·½øÐÐË÷Òý£¬Í¬Ê±ÓÖ»á°Ñ¾ÉµØÖ·ÏÂÔ­ÓеÄÍⲿÁ´½ÓÈçÊýתÒƵ½ÐµØÖ·Ï£¬´Ó¶ø²»»áÈÃÍøÕ¾µÄÅÅÃûÒòΪÍøÖ ......

jsp ÍøÂç

 ÔÚtomcatÏÂÕÒµ½tomcat -> conf -> server.xml ÔÚÕâÒ»¾äÖÐÌí¼ÓºìÉ«²¿·Ö
<Connector connectionTimeout="20000" port="9090" protocol="HTTP/1.1" redirectPort="8443" useBodyEncodingForURI="true"
/> <!--URLEncoding=""--> ± ......

ÔÚjspÖÐÖ±½ÓÊä³ö¶þ½øÖÆͼƬ


<%@ page info="Random Image Show"  
    pageEncoding="UTF-8" contentType="image/jpg"  
    autoFlush="true" buffer="16kb" session="false" import="java.io.FileInputStream"  
%>< ......

JSP/Servletת·¢ÓëÖض¨ÏòµÄÇø±ð

JSP/Servletת·¢ÓëÖض¨ÏòµÄÇø±ð
¾¡¹ÜHttpServletResponse.sendRedirect ·½·¨ºÍRequestDispatcher.forward ·½·¨¶¼¿ÉÒÔÈÃä¯ÀÀÆ÷»ñµÃÁíÍâÒ»¸öURLËùÖ¸ÏòµÄ×ÊÔ´£¬µ«Á½ÕßµÄÄÚ²¿ÔËÐлúÖÆÓÐןܴóµÄÇø±ð¡£
 
¡¡¡¡ÏÂÃæÊÇHttpServletResponse.sendRedirect ·½·¨ÊµÏÖµÄÇëÇóÖض¨ÏòÓëRequestDispatcher.forward ·½·¨ÊµÏÖµÄÇëÇó ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ