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

jspÎļþ¿ªÍ·path, basePath×÷ÓÃ

ÔÚJSPÖеÄÈç¹ûʹÓà "Ïà¶Ô·¾¶"  ÔòÓпÉÄÜ»á³öÏÖÎÊÌâ. 
ÒòΪ ÍøÒ³ÖÐµÄ "Ïà¶Ô·¾¶" , ËûÊÇÏà¶ÔÓÚ "URLÇëÇóµÄµØÖ·" ȥѰÕÒ×ÊÔ´. 
ÉÏÃæÕâ¾ä»°ÊÇʲôÒâË¼ÄØ ? 
¾Ù¸öÀý×Ó: 
¼ÙÈçÎÒÃÇÓÐÒ»¸öÏîÄ¿: MyApp 
ÔÚ¸ÃÏîÄ¿ÏÂ, ÓÐÒ»¸öjspÎļþ¼Ð 
¸ÃÎļþ¼ÐϰüÀ¨: 
login.jsp    // µÇÂ½Ò³Ãæ 
register.jps  // ×¢²áÒ³Ãæ 
ÎÒÃÇÔÚä¯ÀÀÆ÷ÖÐÊäÈëµØÖ· (×¢Òâ: µØÖ·µÄÄÚÈÝ): 
http://localhost:8080/MyApp/jsp/login.jsp 
Õâʱºò, ä¯ÀÀÆ÷»áÁ´½Óµ½ "µÇÂ½Ò³Ãæ" (login.jsp) 
ÔÚlogin.jspÎļþÄÚ°üº¬ÁËÈçÏ "²¿·Ö´úÂë": 
<a href="jsp/register.jsp">×¢²áÓû§ </a> 
ÄÇô,Èç¹ûÎÒÃǵã»÷Õâ¸öÁ´½Ó,¾Í»áÔÚä¯ÀÀÆ÷µØÖ·À¸ÖÐ, ³öÏÖÈçÏ´íÎóÁ´½Ó: 
http://localhost:8080/MyApp/jsp/jsp/register.jsp 
¿´~~ 
Ϊʲô»á³öÏÖ"/jsp/jsp/register.jsp"ÄØ? 
ÒòΪ, ÍøÒ³ÖеÄ"Ïà¶ÔÁ´½Ó", ÊÇÏà¶ÔÓÚÄãËù "ÇëÇóµÄURL·¾¶" Ëù¾ö¶¨µÄ. 
¼´: 
ÒòΪÕâÀïÇëÇó·¾¶ÊÇ:http://localhost:8080/MyApp/jsp/login.jsp 
ÄÇô, ä¯ÀÀÆ÷ ¾Í»áÔÚÕâ¸ö·¾¶ÏÂ(¼´:http://localhost:8080/MyApp/jsp/)È¥ÕÒ jsp/register.jsp 
ËùÒԾͻá³öÏÖÈçÏ´íÎóÄÚÈÝ: 
http://localhost:8080/MyApp/jsp/jsp/register.jsp 
ÉÏÃæµÄÎÊÌ⣬¾ÍÊǵ÷ÓÃÒ³ÃæºÍ±»µ÷ÓÃÒ³ÃæµÄURL²»Í¬ËùÔì³ÉµÄ£¬ 
´ËÀà´íÎóÒ²³£³£»á³öÏÖÔÚ2¸öÒ³ÃæÖ®¼ä½øÐÐ "ת·¢"(forward) ²Ù×÷µÄʱºò¡£ 
ÒòΪforwardÊÇÔÚºǫ́½øÐеģ¬¶Ô¿Í»§¶ËÀ´ËµÊÇ͸Ã÷µÄ¡£(¼´: URL²»¸Ä±ä£¬¶øÊý¾ÝÄÚÈÝÈ´ÊÇÁíÒ»¸öÒ³Ãæ·µ»ØÀ´µÄ¡£¡£¡£) 
ÄÇôÈçºÎ½â¾öÕâÎÊÌâÄØ£¿ 
(Ò»)·½·¨Ò»£ºÖ±½Ó²ÉÓþø¶Ô·¾¶ (²»ÍƼö) 
ÔÚJSPÒ³Ãæ¶Ë£¬»ñµÃ±¾ÏîÄ¿µÄ¾ø¶ÔµØÖ·£¨Èç¹ûÄãµÄÏîÄ¿½ÐMyApp£¬ÄÇô»ñµÃµ½µÄµØÖ·¾ÍÊÇ http://localhost:8080/MyApp/£©: 
´úÂëÈçÏÂ: 
<!-- **************·½·¨Ò»***************** --> 
<%@ page language="java" pageEncoding="GBK" contentType="text/html;charset=gbk" isELIgnored="false"%> 
<% 
String path = request.getContextPath(); 
// »ñµÃ±¾ÏîÄ¿µÄµØÖ·(ÀýÈç: http://localhost:8080/MyApp/)¸³Öµ¸øbasePath±äÁ¿ 
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPo


Ïà¹ØÎĵµ£º

¹ØÓÚJAVA,JSPµÄ1¸öÎÊÌâ

×î½üÔÚѧJAVA£¬Á·Ï°µÄʱºòÓöµ½¸öÎÊÌ⣬Çë´ó¼Ò°ïæ¿´¿´……
Ö÷ÒªÎÊÌâÊÇ£¬ÔÚJSPÖÐûÓа취µ¼ÈëÎÒÏëÓõÄÀ࣬Ã÷Ã÷µ¼ÈëÁ˰ü£¬È´±¨£ºMyDAO cannot be resolved to a type
JSP´úÂ룺
<%@ page contentType="text/html;charset=GBK"%>
<%@ page import="java.util.Date"%>
<%@ page import="java.t ......

ÈçºÎÓÃJBoss ÔËÐÐÏà¹ØµÄJSP³ÌÐò

                                                 ÈçºÎÓÃJBoss ......

jspÂÒÂë½â¾ö

jspÂÒÂë½â¾ö(×ªÔØ)
jspÂÒÂë½â¾ö(×ªÔØ)
JAVA֪ʶ   2009-04-14 08:49   ÔĶÁ935   ÆÀÂÛ5  
GBK±àÂë
GBK±àÂëÊÇÖйúÖÆ¶©µÄ¡¢µÈͬÓÚUCSµÄеÄÖÐÎıàÂëÀ©Õ¹¹ú¼Ò±ê×¼¡£GBK¹¤×÷С×éÓÚ1995Äê10Ô£¬Í¬Äê12ÔÂÍê³ÉGBK¹æ·¶¡£¸Ã±àÂë±ê×¼¼æÈÝGB2312£¬¹²ÊÕ¼ºº×Ö21003¸ö¡¢·ûºÅ883¸ö£¬²¢Ìṩ1 ......

ÔÚTomcat6.0ÖйØÓÚJSP/Servlet±íµ¥ÂÒÂëµÄÒ»¸ö½â¾ö·½·¨

²½ÖèÒ»£º±à¼­TomcatµÄÅäÖÃÎļþconf/server.xmlÔÚÓÃÓÚ½ÓÊܿͻ§¶ËÓï·¨µÄConnector<connector></connector>±êÇ©ÖÐÌí¼ÓURIEncoding="UTF-8"ÊôÐÔ£¬¸ÃÊôÐÔÓÃÀ´½â¾öGETÖеıàÂëÎÊÌâ¡£
xml ´úÂë
<Connector port="8080" protocol="HTTP/1.1" connectionTimeout="20000" redirectPort="8443" URIEncoding="UTF-8" / ......

jsp ǰ̨֪ʶ×ܽá

Ò»¡¢×ܵÄÀ´ËµÕâ¸ö½×¶ÎÖ÷ҪѧϰÁËÒ»ÏÂÕâЩ·½ÃæµÄ֪ʶ
£¨1£©¶ÔÒѾ­ÕÆÎÕÁ˵ÄHTML½øÒ»²½ÊìϤºÍϸ»¯
£¨2£©ÒÔǰ²»´óÊìϤµÄCSSÓиö¸ü½øÒ»²ãµÄÈÏʶµÄÕÆÎÕ
£¨3£©ÔÚVBscriptµÄ»ù´¡ÉÏÈ«ÃæÑ§Ï°ÁËjavascript£¬½Å±¾ÓïÑÔ¿é¿ÉÒÔ˵»ù±¾µÄ¶¼Ó¦¸ÃÄÜ×öµÄ³öÀ´¡£
£¨4£©Ç°ÆÚÒ²¶ÔjavaÖеÄTCPЭÒéºÍUDPЭÒéϵͳµÄѧϰÁËÒ»±é£¬Ò²¾ÍÊÇSOCKET±à³ÌÒ»¿ ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØÍ¼ | ¸ÓICP±¸09004571ºÅ