html:link ¸÷¸öÊôÐÔ½âÊͼ°Ó÷¨
<html:link> ±êÇ©ÓÃÓÚÉú³ÉHTML <a> ÔªËØ¡£<html:link> ÔÚ´´½¨³¬Á´½Óʱ£¬ÓÐÁ½¸öÓŵ㣺
(1) ÔÊÐíÔÚURL ÖÐÒÔ¶àÖÖ·½Ê½°üº¬ÇëÇó²ÎÊý¡£
(2) µ±Óû§ä¯ÀÀÆ÷¹Ø±ÕCookie ʱ£¬»á×Ô¶¯ÖØдURL£¬°ÑSessionID ×÷ΪÇëÇó²ÎÊý°üº¬ÔÚURL ÖУ¬ÓÃÓÚ¸ú×ÙÓû§µÄSession ״̬¡£
<html:link> ±êÇ©ÓÐÒÔÏÂÖØÒªÊôÐÔ£º
(1) forward£ºÖ¸¶¨È«¾Öת·¢Á´½Ó¡£
(2) href£ºÖ¸¶¨ÍêÕûµÄURL ¼ü½Ó¡£
(3) page£ºÖ¸¶¨Ïà¶ÔÓÚµ±Ç°ÍøÒ³µÄURL¡£
<html:rewrite> ÓÃÓÚÊä³ö³¬Á´½ÓÖеÄURI²¿·Ö£¬µ«Ëü²¢²»Éú³ÉHTML <a> ÔªËØ¡£URIÖ¸µÄÊÇURL ÖÐÐÒé¡¢Ö÷»úºÍ¶Ë¿ÚÒÔºóµÄÄÚÈÝ¡£URI ÓÃÓÚÖ¸¶¨¾ßÌåµÄÇëÇó×ÊÔ´¡£ÀýÈ磬¶ÔÓÚURL£ºHTTP£º//localhost:8080/HtmlBasic.do£¬ËüµÄURIΪ /HtmlBasic.do
ʾÀý£º
1¡¢´´½¨È«¾Öת·¢Á´½Ó
Ê×ÏÈ£¬ÔÚStruts-config.xml ÖÐ<global-forwards> ÔªËØÖж¨ÒåÒ»¸ö<forward> ÔªËØ£º
<global-forwards>
<forward name = "index" path="/index.jsp"/>
</global-forwards>
½Ó×Å£¬ÔÚJSP ÎļþÖд´½¨<html:link> ±êÇ©£º
<html:link forward="index">
Link to Global ActionForward
</html:link>
<html:link> ±êÇ©µÄforward ÊôÐÔºÍ<global-forwards> ÔªËØÖеÄ<forward> ×ÓÔªËØÆ¥Åä¡£ÒÔÉÏ´úÂëÉú³ÉÈçÏÂHTML ÄÚÈÝ£º
<a href="/index.jsp" mce_href="index.jsp">Link to Global ActionFoward</a>
ÖµµÃ×¢ÒâµÄÊÇ£¬<html:link> µÄforward ÊôÐÔÖ»ÒýÓÃStruts-config.xml ÅäÖÃÎļþÖÐ<global-forwards>ÄÚµÄ<forward> ×ÓÔªËØ£¬Èç¹ûÒýÓÃ<action> ÄÚµÄ<forward> ×ÓÔªËØ£¬ÔÚÔËÐÐʱ½«»áÅ׳öÒì³££º
Cannot c
Ïà¹ØÎĵµ£º
<html:html>±êÇ©ÓÐÒ»¸ö lang ÊôÐÔ£¬ÓÃÓÚÏÔʾÓû§Ê¹ÓõÄÓïÑÔ£º
<html:html lang="true">
Èç¹û¿Í»§ä¯ÀÀÆ÷ʹÓÃÖÐÎÄ£¬ÄÇôÒÔÉÏ´úÂëÔÚÔËÐÐʱ½«±»½âÎöΪÆÕͨµÄ HTML ´úÂ룺
<html lang="zh-CN">
½âÊÍ£ºµ± lang ÊôÐÔΪ "true ......
ÎļþÀàÐÍ <HTML></HTML> £¨·ÅÔÚµµ°¸µÄ¿ªÍ·Óë½á⣩
ÎļþÖ÷Ìâ <TITLE></TITLE> £¨±ØÐë·ÅÔÚ¡¸ÎÄÍ·¡¹Çø¿éÄÚ£©
ÎÄÍ· <HEAD></HEAD> £¨ÃèÊöÐÔ×ÊÁÏ£¬ÏñÊÇ¡¸Ö÷Ì⡹£©
ÎÄÌå <BODY></BODY> £¨Îļþ±¾Ì壩
½á¹¹ÐÔ¶¨Ò壨ÓÉä¯ÀÀÆ÷¿ØÖƵÄÏÔʾ·ç¸ñ£©
±êÌâ <H?></H?> ......
//½ØÈ¡²¿·ÖÄÚÈÝ·½·¨
public static string strvalue(string value, int length)
{
string strValue = NoHTML(value);// È¥³ýHTML±ê¼Ç
&nb ......
<label> ±êǩΪ input ÔªËض¨Òå±ê×¢£¨±ê¼Ç£©¡£
label ÔªËز»»áÏòÓû§³ÊÏÖÈκÎÌØÊâЧ¹û¡£²»¹ý£¬ËüΪÊó±êÓû§¸Ä½øÁË¿ÉÓÃÐÔ¡£Èç¹ûÄúÔÚ label ÔªËØÄÚµã»÷Îı¾£¬¾Í»á´¥·¢´Ë¿Ø¼þ¡£¾ÍÊÇ˵£¬µ±Óû§Ñ¡Ôñ¸Ã±êǩʱ£¬ä¯ÀÀÆ÷¾Í»á×Ô¶¯½«½¹µãתµ½ºÍ±êÇ©Ïà¹ØµÄ±íµ¥¿Ø¼þÉÏ¡£
<label> ±êÇ©µÄ for ÊôÐÔÓ¦µ±ÓëÏà¹ØÔªËØµÄ id ÊôÐÔÏ ......
ÐÞ¸Ä checked ÊôÐÔ
var sex = '${entity.sex}';
if(sex == 'ÄÐ')
{
//document.all.sexCk1.checked=true; ÕâÖÖ»ðºü²»Ö§³Ö
&nbs ......