StrutsÖÐhtml±êÇ©µÄÓ÷¨
±êÇ©ÓÃÓÚÉú³ÉÒ»¸öHTML form¡£Ê¹Óøñêǩʱ±ØÐë×ñÑÐí¶à¹æÔò¡£
Ê×ÏÈ£¬±êÇ©ÖбØÐë°üº¬Ò»¸öactionÊôÐÔ£¬ËüÊÇÕâ¸ö±êÇ©ÖÐΨһ±ØÐèµÄÊôÐÔ¡£Èç¹û²»¾ß±¸¸ÃÊôÐÔÔòJSPÒ³Ãæ»áÅ׳öÒ»¸öÒì³£¡£Ö®ºóÄã±ØÐë¸øÕâ¸öactionÊôÐÔÖ¸¶¨Ò»¸öÓÐЧֵ¡£Ò»¸öÓÐЧֵÊÇÖ¸Ó¦ÓóÌÐòµÄStrutsÅäÖÃÎļþÖÐÔªËØÀïµÄÈκÎÒ»¸ö×ÓÔªËصķÃÎÊ·¾¶¡£¶øÇÒÏàÓ¦µÄÔªËØÖбØÐëÓÐÒ»¸önameÊôÐÔ£¬ËüµÄÖµÊÇform beanµÄÃû³Æ¡£
ÀýÈ磬Èç¹ûÄãÓÐÕâÑùÒ»¸ö±êÇ©£º <html:form action=\"/login\" >
ÄÇôÄãµÄStrutsÅäÖÃÎļþµÄÔªËØÖбØÐëÓÐÒ»¸öÈçÏÂÏÔʾΪ´ÖÌåµÄÔªËØ£º <action-mappings>
<action path=\"/login\"
type=\"com.javapro.struts.LoginAction\"
name=\"loginForm\"
scope=\"request\"
input=\"/login.jsp\">
<forward name=\"success\" path=\"/mainMenu.jsp\"/>
</action>
.
.
.
</action-mappings>
Õâ¾ÍÊÇ˵һ¸öform±êÇ©ÊǺÍform beanÏà¹ØÁªµÄ¡£
ÁíÒ»¸öÒª×ñѵĹæÔòÊÇ£ºÈκΰüº¬ÔÚ<form>ÖÐÓÃÀ´½ÓÊÕÓû§ÊäÈëµÄ±êÇ©£¨<text>¡¢<password>¡¢<hidden>¡¢<textarea>¡¢<radio>¡¢<checkbox>¡¢<select>£©±ØÐëÔÚÏà¹ØµÄform beanÖÐÓÐÒ»¸öÖ¸¶¨µÄÊôÐÔÖµ¡£±ÈÈ磬Èç¹ûÄãÓÐÒ»¸öÊôÐÔÖµ±»Ö¸¶¨Îª“username”µÄ<text>±êÇ©£¬ÄÇôÏà¹ØµÄform beanÖÐÒ²±ØÐëÓÐÒ»¸öÃûΪ“username”µÄÊôÐÔ¡£ÊäÈë<text>±êÇ©ÖеÄÖµ»á±»ÓÃÓÚÉú³Éform beanµÄuserNameÊôÐÔ¡£
³ýÁËÉÏÃæËù½²µÄÊôÐÔÖ®Í⣬<form>±êÇ©»¹ÓÐһЩ²»ÊDZØÐ뵫¼ÓÉϸüºÃµÄ“´ÎÒª”µÄÊôÐÔ¡£±ÈÈ磬Äã¿ÉÒÔÓÃfocusÊôÐÔÀ´Éú³ÉJavaScript£¬Ëü»á“¶¨½¹”£¨focus£©µ½¸ÃformËù°üº¬µÄÒ»¸öÔªËØÉÏ¡£Ê¹ÓÃfocusÊôÐÔʱÄãÐèÒª¸øËüÖ¸¶¨ÔªËصÄÃû³Æ¡£±ÈÈ磬ÒÔÏ´úÂëÊǶ¨½¹ÔÚµÚ¶þ¸öTextÔªËØÉϵģº <body>
<html:form action=\"/login\" focus=\"password\">
User Name: <html:text property=\"userName\"/>
<br>Password: <html:text property=\"password\"/>
<br><
Ïà¹ØÎĵµ£º
ÈçºÎÓÐÒ»¸ö×Ö·û´®ÊÇÕâÑùµÄÐÎʽstr = "&bbbLAA";
ÏëµÃµ½"L"µÄ»°¿ÉÒÔÕâÑùȥʵÏÖ£º
//sDataStr = "&bbbLAA";
//sLeftQuote = ""&bbb";
//sRightQuote = "&AA";
µ÷ÓÃÕâ¸ö·½·¨½«µÃµ½L×ֶΡ£
function abCutString( sDataStr, sLeftQuote, sRightQuote)
{
var sReturnVal = '';
var nStart ......
HTML ¼òÊ·
HTML ÊÇ Web ͳһÓïÑÔ£¬ÕâЩÈÝÄÉÔÚ¼âÀ¨ºÅÀïµÄ¼òµ¥±êÇ©£¬¹¹³ÉÁËÈç½ñµÄ Web¡£1991 Ä꣬Tim Berners-Lee ±àдÁËÒ»·Ý½Ð×ö “HTML ±êÇ©”µÄÎĵµ£¬ÀïÃæ°üº¬ÁË´óÔ¼20¸öÓÃÀ´±ê¼ÇÍøÒ³µÄ HTML ±êÇ©¡£ËûÖ±½Ó½èÓà SGML µÄ±ê¼Ç¸ñʽ£¬Ò²¾ÍÊǺóÀ´ÎÒÃÇ¿´µ½µÄ HTML ±ê¼ÇµÄ¸ñʽ¡£±¾ÎĽ²Ê ......
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta content="text/html; charset=gb2312" http-equiv="Content-Type" />
<title>¼òµ¥µÄ²âÊÔÒ³Ãæ</title> ......
XMLºÍHTML³£ÓÃתÒå×Ö·û
XMLºÍHTMLÖж¼ÓÐһЩÌØÊâµÄ×Ö·û£¬ÕâЩ×Ö·ûÔÚXMLºÍHTMLÖÐÊDz»ÄÜÖ±½ÓʹÓõģ¬Èç¹û±ØÐëʹÓÃÕâЩ×Ö·û£¬Ó¦¸ÃʹÓÃÆä¶ÔÓ¦µÄתÒå×Ö·û¡£
Èç¹ûÔÚXMLÎĵµÖÐʹÓÃÀàËÆ"<" µÄ×Ö·û, ÄÇô½âÎöÆ÷½«»á³öÏÖ´íÎó£¬ÒòΪ½âÎöÆ÷»áÈÏΪÕâÊÇÒ»¸öÐÂÔªËصĿªÊ¼¡£
ËùÒÔ²»Ó¦¸ÃÏñÏÂÃæÄÇÑùÊéд´úÂë:
<message&g ......
protected override void OnPreInit(EventArgs e)
{
base.OnPreInit(e);
string ......