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

jspÄÚÖöÔÏó

1.request¶ÔÏó
  ¸Ã¶ÔÏó·â×°ÁËÓû§Ìá½»µÄÐÅÏ¢£¬Í¨¹ýµ÷ÓøöÔÏóµÄÏìÓ¦µÄ·½·¨¿ÉÒÔ»ñÈ¡Óû§Ìá½»µÄÐÅÏ¢¡£
  µ±request¶ÔÏó»ñÈ¡Óû§Ìá½»µÄºº×Ö×Ö·ûʱ£¬»á²úÉúÂÒÂ룬ÓÉÏÂÃæµÄ·½·¨¿ÉÒÔ½â¾ö£º
  Sting  s2 = new   String(s1.getBytes("iso8859-1"),"GB2312")½øÐÐת»»¡£
 request³£Óõķ½·¨£º
 
 1.request.getParameter("name"); »ñÈ¡±íµ¥Ìá½»µÄÐÅÏ¢
 2.request.getProtocol();        »ñÈ¡¿Í»§¶ËʹÓõÄЭÒé
 3.request.getServletPath();     »ñÈ¡¿Í»§Ìá½»ÐÅÏ¢µÄÒ³Ãæ
 4.request.getMethod();          »ñÈ¡¿Í»§Ìá½»ÐÅÏ¢µÄ·½·¨
 5.request.getHeader();          »ñÈ¡httpÏûϢͷÖÐÊôÐÔµÄÖµ È磺accept¡¢accept-encoding¡¢host
 6.request.getRemoteAddr();      »ñÈ¡¿Í»§µÄipµØÖ·
 7.request.getRemoteHost();      »ñÈ¡¿Í»§»úµÄÃû³Æ
 8.request.getServerName();      »ñÈ¡·þÎñÆ÷µÄÃû³Æ
 9.request.getServerPort();      »ñÈ¡·þÎñÆ÷µÄ¶Ë¿ÚºÅ
 10.request.getParameterNames(); »ñÈ¡¿Í»§¶ËÌá½»µÄËùÓвÎÊýµÄÃû×Ö
 response¶ÔÏóµÄʹÓ÷½·¨
 ¶Ô¿Í»§µÄÇëÇó×÷³ö¶¯Ì¬µÄÏìÓ¦£¬Ïò¿Í»§¶Ë·¢ËÍÊý¾Ý
1.¶¯Ì¬ÏìÓ¦contentTypeÊôÐÔ
 µ±Ò»¸öÓû§·ÃÎÊÒ»¸öJSPÒ³Ãæʱ£¬Èç¹û¸ÃÒ³ÃæÓÃpageÖ¸ÁîÉèÖÃÒ³ÃæµÄcontentTypeÊôÐÔʱtext/html£¬ÄÇôJSPÒýÇ潫°´ÕÕÕâ¸öÊôÐÔÖµ×ö³ö·´Ó¦¡£Èç¹ûÒª¶¯Ì¬¸Ä±äÕâ»»¸öÊôÐÔÖµÀ´ÏìÓ¦¿Í»§£¬¾ÍÐèҪʹÓÃResponse¶ÔÏóµÄsetContentType(String s)·½·¨À´¸Ä±äcontentTypeµÄÊôÐÔÖµ¡£
¸ñʽ£ºresponse.setContentType(String s);
²ÎÊýs¿ÉÈ¡text/html,application/x-msexcel,application/mswordµÈ¡£
2.ResponseÖض¨Ïò
ÔÚijЩÇé¿öÏ£¬µ±ÏìÓ¦¿Í»§Ê±£¬ÐèÒª½«¿Í»§ÖØÐÂÒýµ¼ÖÁÁíÒ»¸öÒ³Ã棬¿ÉÒÔʹÓÃResponseµÄsendRedirect(URL)·½·¨ÊµÏÖ¿Í»§µÄÖض¨Ïò¡£ÀýÈ磺
response.sendRedirect("index.jsp");
3.session¶ÔÏó
 Ê²Ã´ÊÇsession¶ÔÏó£¿
 ËüÔÚµÚÒ»¸öjspÒ³Ãæ±»¼ÓÔØʱ×Ô¶¯´´½¨£¬Íê³É»á»°ÆÚ¹ÜÀí£¬´ÓÒ»¸ö¿Í»§´ò¿ªä¯ÀÀÆ÷²¢Á¬½Ó·þÎñÆ÷¿ªÊ¼£¬µ½¿Í»§¹Ø±Õä¯ÀÀ


Ïà¹ØÎĵµ£º

Apache¡¢Tomcat¡¢IIS£¨PHP¡¢JSP¡¢ASP£©¹²´æʱµÄÉèÖÃ

1¡¢·Ö±ð°²×°Èý¸ö»·¾³£¬²¢ÉèÖò»Í¬¶Ë¿Ú
PHP:80
JSP:8080
ASP:8081
2¡¢ÉèÖÃ/Apache2/conf/httpd.conf
È¥µôÒÔÏÂÈýÐÐÇ°µÄ×¢ÊÍ£º
LoadModule proxy_module modules/mod_proxy.so
LoadModule proxy_connect_module modules/mod_proxy_connect.so
LoadModule proxy_http_module modules/mod_proxy_http.so
¼ÓÈëÒÔϼ¸ÐУº ......

JSP/FreeMarkerÉú³ÉRSS


¡¡¡¡ RSS2.0ÔÚÍøÂçÉÏ´óÐÐÆäµÀ,¸÷ÖÖÍøÕ¾¶¼¼ÓÉÏRSSÖ§³Ö,¹ØÓÚRSS¹æ·¶,¿ÉÒÔä¯ÀÀһϠhttp://blogs.law.harvard.edu/tech/rss
Ôڼƻ®Éú³ÉRSSÎļþµÄʱºò,˳±ãËÑË÷ÁËÒ»ÏÂJIRAºÍConfluenceµÄ³ÌÐò,·¢ÏÖËüÃÇ·Ö±ðÊÇÓÃÄ£°å·½Ê½ºÍJSP¶¯Ì¬Ò³ÃæÀ´Õ¹Ê¾µÄ.
ÓÚÊÇÎÒÒ²Ïëµ½Á½ÖÖ·½Ê½:
¡¡¡¡1.ÓÃFreeMarkerÉú³É¾²Ì¬Îļþ,ÊÊÓÃÓÚ¸üв ......

ASPÓëJSP ¹ØÓÚÒ³ÃæµÄÊäÈëºÍÊä³öµÄÎÊÌâ

Ò³ÃæµÄÊäÈëºÍÊä³öÉæ¼°µ½ÁËRequestºÍResponse,ÓÉÓÚËûÃǺÍJspÖеÄÏàËÆ,
ÏÂÃæÎÒÃǽøÐÐÏêϸµÄ½â¶Á£º
JSPÖУº
    ÔÚ¶¯Ì¬ÍøÒ³¿ª·¢ÖУ¬HTML±íµ¥ÊÇÓëÓû§½»»¥ÐÅÏ¢µÄÖ÷ÒªÊֶΡ£
    ʹÓÃJSP´¦Àí±íµ¥ÇëÇóʱ£¬Ò»°ã×ñÑ­ÕâÑùÒ»ÖÖģʽ£¬Ê×ÏÈ£¬Óû§Í¨¹ý±íµ¥¿Ø¼þÊäÈë²¢Ìá½»ÐÅÏ¢;½Ó×Å£¬JSPÒ³Ãæ»ñµÃ±íµ¥Êý ......

תÔØ jspËٳɾ«Òª

ServletÈý¸öÒªËØ:
1.±ØÐë¼Ì³Ð×ÔHttpServlet
2.±ØÐëʵÏÖdoGet()»òÕßdoPost()
3.±ØÐëÔÚweb.xmlÖÐÅäÖÃServlet
<servlet>
<servlet-name> </servlet-name>
<servlet-class> </servlet-class>
</servlet>
<servlet-mapping>
<servlet-name> </servlet-nam ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ