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

ʯ¼ÒׯÍøÕ¾Éè¼Æ£ºjspÍøÕ¾µÄ¾²Ì¬Ò³ÃæÉú³É·½°¸

ʯ¼ÒׯÌáÉýÍøÕ¾ÐÔÄܵķ½Ê½Óкܶ࣬ÀýÈçÓÐЧµÄʹÓûº´æ£¬Éú³É¾²Ì¬Ò³ÃæµÈµÈ¡£½ñÌìҪ˵µÄ¾Í
ÊÇÉú³É¾²Ì¬Ò³ÃæµÄ·½Ê½¡£
ʲô½ÐÉú³É¾²Ì¬Ò³ÃæÄØ£¿ºÜ¼òµ¥£¬ÀýÈçÎÒÃÇÈç¹û·ÃÎÊÒ»¸öÁ´½Ó http://xyz.com/index.do£¬
ÄÇô·þÎñÆ÷¾Í»á½âÎöÕâ¸öÇëÇó£¬ÈÃÌض¨µÄAction È¥´¦Àí¡£ÕâÆäÖеÄȱµãÊÇÏÔ¶øÒ×¼ûµÄ£ºÈç¹û
·ÃÎʵÄÈË£¬ÄÇô¾Í»á¼ÓÖØÓ¦Ó÷þÎñÆ÷µÄѹÁ¦£¬×î¶ñÁӵĺó¹û¾ÍÊÇÓ¦Ó÷þÎñÆ÷down µôÁË¡£ÄÇ
ôÈçºÎÈ¥±ÜÃâÄØ£¿Èç¹ûÎÒÃÇ°Ñ¶Ô index.do ÇëÇóºóµÄ½á¹û±£´æ³ÉÒ»¸ö html Îļþ£¬È»ºóÿ´Î
Óû§¶¼È¥·ÃÎÊ http://xyz.com/index.html £¬ÕâÑùÓ¦Ó÷þÎñÆ÷µÄѹÁ¦²»¾Í¼õÉÙÁË£¿
ºÃ°É£¬ÎÒÒѾ­Ñ§»áÈçºÎÉú³É¾²Ì¬Ò³ÃæÁË¡£´ò¿ªÎÒµÄä¯ÀÀÆ÷£¬ÊäÈë http://xyz.com/index.do£¬
È»ºóÔÙʹÓÓÁí´æΪ”¹¦Äܱ£´æÒ»¸öhtml Îļþ£¬È»ºóÉÏ´«µ½·þÎñÆ÷£¬ÕâÑù¾Íok ÁË£¡
ÎÒ²»ÄÜ˵Õâ²»Êǽâ¾ö·½°¸£¬µ«ÊÇÎÒ¿ÉÒÔ˵Õâ²»ÊǺõĽâ¾ö·½°¸¡£ÎÒÃÇÐèÒªµÄÊÇ×Ô¶¯µÄÉú
³É¾²Ì¬Ò³Ã棬µ±Óû§·ÃÎÊ http://xyz.com/index.do£¬»á×Ô¶¯Éú³É index.html £¬È»ºóÏÔʾ¸ø
Óû§¡£
1¡¢ »ù´¡—URL Rewrite
ʲôÊÇ URL Rewrite ÄØ£¿Çë google it ☺ ¡£²»¹ýÕâÀï¼òµ¥µÄ啰àÂһϡ£´Ó×ÖÃæ
ÉÏÎÒÃǾͿÉÒÔÀí½âËüµÄÒâ˼£ºURL ÖØд¡£ÓÃÒ»¸ö¼òµ¥µÄÀý×ÓÀ´ËµÃ÷ÎÊÌ⣺ÊäÈëÍøÖ· copyright dedecms
http://www.xyz.com/index.do £¬ µ«ÊÇʵ¼ÊÉÏ·ÃÎʵÄÈ´ÊÇ
http://www.xyz.com/index.action£¬ÄÇÎÒÃǾͿÉÒÔ˵URL ±»ÖØдÁË¡£ÕâÏî¼¼ÊõÓ¦ÓÃ
¹ã·º£¬ÓÐÐí¶à¿ªÔ´µÄ¹¤¾ß¿ÉÒÔʵÏÖÕâ¸ö¹¦ÄÜ¡£
2¡¢ »ù´¡—Servlet web.xml
Èç¹ûÄ㻹²»ÖªµÀweb.xml ÖÐÒ»¸öÇëÇóºÍÒ»¸öservlet ÊÇÈçºÎÆ¥Åäµ½Ò»ÆðµÄ£¬ÄÇô
ÇëËÑË÷һϠservlet µÄÎĵµ¡£Õâ¿É²»ÊÇÂÒ˵ѽ£¬ÓкܶàÈ˾ÍÈÏΪ /xyz/*.do ÕâÑùµÄÆ¥
Å䷽ʽÄÜÓÐЧ¡£
Èç¹ûÄ㻹²»ÖªµÀÔõô±àдһ¸ö servlet £¬ÄÇôÇëËÑË÷Ò»ÏÂÈçºÎ±àдservlet¡£Õâ¿É
²»ÊÇ˵Цѽ£¬ÔÚ¸÷ÖÖ¼¯³É¹¤¾ßÂþÌì·ÉÎèµÄ½ñÌ죬ºÜ¶àÈ˶¼²»»áÈ¥´ÓÁã±àдһ¸öservlet
ÁË¡£
3¡¢ ̸̸·½·¨
ºÃÁË£¬ÏÖÔÚ²½ÈëÕýÌ⡣̸̸Éú³É¾²Ì¬Ò³ÃæµÄ·½·¨(»¹ÊDz»ÒªËµ³É“Ô­À픣¬¸øÈËÒ»ÖÖ
ºÜ¸ßÉîµÄ¸Ð¾õ)¡£·½·¨¾ÍÊÇÕâÑù£º
·½·¨1
ÆäÖУ¬¶ÔÓÚURL Rewriter µÄ²¿·Ö£¬¿ÉÒÔʹÓÃÊÕ·Ñ»òÕß¿ªÔ´µÄ¹¤¾ßÀ´ÊµÏÖ£¬Èç¹û url
²»ÊÇÌرðµÄ¸´ÔÓ£¬¿ÉÒÔ¿¼ÂÇÔÚ servlet ÖÐʵÏÖ£¬ÄÇô¾ÍÊÇÏÂÃæÕâ¸öÑù×Ó£º
´¦Àí .action µÄservlet
ÇëÇó index
URL
Rewriter
ÇëÇó index.action
Èç¹û¾²Ì¬Ò³Ãæ
´æÔÚ
ÏÔʾ¾²Ì¬Ò³Ãæ
Éú³É¾²Ì¬Ò³Ãæ
ÏÔʾ¾²Ì¬Ò³Ãæ
ÄÚÈÝÀ´×


Ïà¹ØÎĵµ£º

JSPÂÒÂëÎÊÌâÏà¹Ø

JSPÖгöÏÖÂÒÂ룬Ê×Ïȼì²éÒ»ÏÂpageEncodingºÍcontentTypeÁ½¸öÊôÐÔ£¬Á½¸öÊôÐÔµÄĬÈÏÖµ¶¼ÊÇISO-8859-1
pageEncodingÉèÖõÄÊDZàÒëJSPʱËùÓõıàÂ룬Èç¹ûÓÃĬÈϵıàÂë±àÒëÖÐÎÄ£¬ÄÇôÔÚJSP±àÒë½×¶ÎÒѾ­ÊÇÂÒÂëÁË¡£
contentTypeÉèÖõÄÊÇ·þÎñ¶Ë·¶Î§¸øä¯ÀÀÆ÷µÄÏÔʾ±àÂ룬ºÍÒ³ÃæÉÏÉèÖñàÂëÊÇÒ»ÑùµÄЧ¹û¡£ ......

JSPµÄÅäÖÃ

¿ª·¢»·¾³ÅäÖÃ
¡¡¡¡
¡¡¡¡Ò»¡¢¿ª·¢»·¾³ÅäÖÃ
¡¡¡¡
¡¡¡¡µÚÒ»²½£ºÏÂÔØj2sdkºÍtomcat£ºµ½sun¹Ù·½Õ¾£¨http://java.sun.com/j2se/1.5.0/download.jsp£©ÏÂÔØj2sdk£¬×¢ÒâÏÂÔذ汾ΪWindows Offline InstallationµÄSDK£¬Í¬Ê±×îºÃÏÂÔØJ2SE 1.5.0 Documentation£¬È»ºóµ½tomcat¹Ù·½Õ¾µã£¨http://jakarta.apache.org/site/downloads/do ......

JSP½áºÏXML+XSLT½«Êä³öת»»HTML


ÎÒÃÇÖªµÀ XML+XSLT¾Í¿ÉÒÔÖ±½ÓÊä³öµ½Ö§³ÖXMLµÄä¯ÀÀÆ÷ÉÏ,ÈçIE 5.0ÒÔÉÏ,µ«ÊÇ,ÎÒÃÇ»¹Òª¿¼Âǵ½Óв»ÉÙä¯ÀÀÆ÷²»Ö±½ÓÖ§³ÖXML,ÔÚÕâÖÖÇé¿öÏÂ,ÎÒÃÇÐèÒªÔÚ·þÎñÆ÷ÉϽøÐÐת»»³ÉhtmlÊä³öµ½ä¯ÀÀÆ÷,ÕâÖÖÁÙʱ¹ý¶É°ì·¨¿ÖÅÂÒªÔÚÒ»¶Îʱ¼äÄÚһֱҪʹÓÃ.
¡¡¡¡Ê¹ÓÃJsp ¼ÓÉÏtablib±êʶ¿â,ÎÒÃÇ¿ÉÒÔÍê³ÉÕâÖÖת»»¡£
¡¡¡¡ÖøÃûopen sourceÏîÄ¿×éjakar ......

jsp¶ÁÈ¡foxproµÄdbfÎļþ

<%@page contentType="text/html"%>
<%@page pageEncoding="GBK"%>
<%@page import="java.sql.*;" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
    <head>
    &n ......

JSPÓï·¨µÄxml±í´ï

´ó¼Ò×ÜÊDz»Ï²»¶¿´µ½<%ºÍ%>ÔÚjspÒ³ÃæÉÏ£¬ÆäʵÎÒÃÇ¿ÉÒÔʹÓñȽÏÓÅÑŵÄxml·½Ê½À´±í´ï
1£¬Òþº¬µÄ×¢ÊÍ
JSPÓï·¨£º<%-- ÄÚÈÝ --%>
XMLÓï·¨£ºÎÞ
2£¬±äÁ¿»òº¯ÊýµÄÉùÃ÷
JSPÓï·¨:<%! declaration;[declaration;]+... %>
ÀýÈ磺
<%!
   int i=0;int a,b,c;
   Color red=new Color( ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ