Ïà¶Ô·¾¶/¾ø¶Ô·¾¶(¾ÙÀýÒ»html)
http://localhost:8080/tj16/
"/"´ú±í¸ùĿ¼£¬"./" ´ú±íµ±Ç°Ä¿Â¼£¬"../"´ú±íÉϼ¶Ä¿Â¼¡£
·þÎñÆ÷¶ËµÄÏà¶ÔµØÖ·Ö¸µÄÊÇÏà¶ÔÓÚÄãµÄwebÓ¦ÓõĵØÖ·£¬ÊÇÔÚ·þÎñÆ÷¶Ë½âÎöµÄ¡£(http://localhost:8080/tj16/)
htmlÒ³ÃæÖеÄÏà¶ÔµØÖ·¶¼ÊÇÏà¶ÔÓÚ·þÎñÆ÷¸ùĿ¼£¬Êǿͻ§¶Ëä¯ÀÀÆ÷½âÎöµÄ¡£(http://localhost:8080/)
webapp tj16
i:/test/tj16/a.jsp
i:/test/tj16/aa/aa.jsp
i:/test/tj16/aa/bb.jsp
i:/test/tj16/aa/cc/c.jsp
µØÖ·À¸ÖÐÊäÈëµØÖ·£º[http://localhost:8080/tj16/aa/aa.jsp]
aa.jspÖÐÄÚÈÝ
(1)<a href="../a.jsp">test1</a> || Á¬½Óµ½[http://localhost:8080/tj16/a.jsp]
(2)<a href="/tj16/a.jsp">test2</a> || Á¬½Óµ½[http://localhost:8080/tj16/a.jsp]
(3)<a href="/a.jsp">test3</a> || Á¬½Óµ½[http://localhost:8080/a.jsp]
(4)<a href="./bb.jsp">test4</a> || Á¬½Óµ½[http://localhost:8080/aa/bb.jsp]
(5)<a href="bb.jsp">test5</a> || Á¬½Óµ½[http://localhost:8080/aa/bb.jsp]
(6)<a href="cc/c.jsp">test6</a> || Á¬½Óµ½[http://localhost:8080/aa/cc/c.jsp]
ÉèÖÃ<form>±êÇ©ÖеÄactionֵΪÉÏÃæµÄhrefÖµ£¬Á½Õߵõ½µÄ½á¹ûÒ»ÖÂ(Ò»Ö£ºµØÖ·À¸ÖеĽá¹ûºÍÒ³ÃæÏÔʾµÄ½á¹û)¡£
[for example:]
<form action="/tj16/a.jsp">
<input type="submit">
</form>
·¾¶½âÎö£º[http://localhost:8080/tj16/aa/aa.jsp]
(a) "/" ---->[http://localhost:8080/] (¸ùĿ¼)
(b) "./" --->[http://localhost:8080/tj16/aa/] (µ±Ç°Ä¿Â¼)
(c) "../"--->[http://localhost:8080/tj16/] (ÉÏÒ»¼¶Ä¿Â¼)
×¢£ºµ±Ç°Ä¿Â¼¿ÉÒÔÊ¡ÂÔ²»Ð´£¬Èçaa.jspÖеÄ(5)ºÍ(4)½á¹ûÊÇÒ»ÑùµÄ
´Ó½á¹û¿ÉÒÔ¿´³ö£¬ÕâÈýÕß"/",
Ïà¹ØÎĵµ£º
metaÊÇÓÃÀ´ÔÚHTMLÎĵµÖÐÄ£ÄâHTTPÐÒéµÄÏìӦͷ±¨ÎÄ¡£meta
±êÇ©ÓÃÓÚÍøÒ³µÄ<head>Óë</head>ÖУ¬meta ±êÇ©µÄÓô¦ºÜ¶à¡£meta
µÄÊôÐÔÓÐÁ½ÖÖ£ºnameºÍhttp-equiv¡£nameÊôÐÔÖ÷ÒªÓÃÓÚÃèÊöÍøÒ³£¬¶ÔÓ¦ÓÚcontent£¨ÍøÒ³ÄÚÈÝ£©£¬ÒÔ±ãÓÚËÑË÷ÒýÇæ»úÆ÷È˲éÕÒ¡¢·ÖÀࣨĿ
ǰ¼¸ºõËùÓеÄËÑË÷ÒýÇæ¶¼Ê¹ÓÃÍøÉÏ»úÆ÷ÈË×Ô¶¯²éÕ ......
<input type="text" value="" maxlength="18"
name="goods.goodsName" value="${goods.goodsName}"
style="width: 99%;" id="goodsName">
value ÊôÐÔ ÖØ¸´ £¬ µ¼Ö嵀 input Ç°Ì¨Ò³Ãæ Öµ Ϊ ""
ÒÔµÚÒ»¸öÊôÐÔµÄÖµÎª× ......
1. web.config
<connectionStrings>
<add name ="myconn" connectionString="Data Source=who\SQLEXPRESS; Initial Catalog=dbname;Integrated Security=True;" providerName="System.Data.SqlClient"/>
</connectionStrings>
2.
string htmlPath = "D:\\htmlFiles";
......
=======<html:messages>============
Action ÖÐ :
ActionMessages message = new ActionMessages();
message.add(" ÏûÏ¢¾ä±ú ",new ActionMessage(" ×ÊÔ´ÎļþÖÐ Key Öµ ",String ÀàÐÍÃèÊöÐÅÏ¢ ));
this.addMessages(request,message);
......