HTML:MESSAGES,HTML:ERRORS,Ó÷¨
=======<html:messages>============
Action ÖÐ :
ActionMessages message = new ActionMessages();
message.add(" ÏûÏ¢¾ä±ú ",new ActionMessage(" ×ÊÔ´ÎļþÖÐ Key Öµ ",String ÀàÐÍÃèÊöÐÅÏ¢ ));
this.addMessages(request,message);
return ActionForward;
JSP Ò³ÃæÖÐ :
<html:messages id=" Ö¸¶¨Ê¹ÓÃÏûÏ¢µÄ±êʶ " property=" ÏûÏ¢¾ä±ú " message="true|false">
<bean:write name=" ÒÔÉÏËùÖ¸ ID ±êʶ "/>
</html:messages>
==========<html:errors>==============
Action ÖÐ :
ActionMessages message = new ActionMessages();
message.add(" ÏûÏ¢¾ä±ú ",new ActionMessage(" ×ÊÔ´ÎļþÖÐ Key Öµ ",String ÀàÐÍÃèÊöÐÅÏ¢ ));
this.saveErrors(request,message);
return ActionForward;
JSP Ò³ÃæÖÐ :
<html:errors property=" ÏûÏ¢¾ä±ú "/>
Èç¹ûActionÖÐÕâÑùÉ趨(false)£¬Ò³ÃæµÄÌáʾÐÅÏ¢½«²»´Ó×ÊÔ´ÎļþÀï¶ÁÈ¡:
ActionMessages message = new ActionMessages();
message.add("ÏûÏ¢¾ä±ú",new ActionMessage("StringÀàÐÍÃèÊöÐÅÏ¢",false));
this.saveErrors(request,message);
return ActionForward;
JSPÒ³Ãæ:
<html:errors/>»ò<html:errors property="ÏûÏ¢¾ä±ú"/>
Ïà¹ØÎĵµ£º
HTML:
<META HTTP-EQUIV="pragma" CONTENT="no-cache">
<META HTTP-EQUIV="Cache-Control" CONTENT="no-cache, must-revalidate">
<META HTTP-EQUIV="expires" CONTENT="Wed, 26 Feb 1997 08:21:57 GMT">
<META HTTP-EQUIV="expires" CONTENT="0">
PHP£º
header("Expires: Mon, 26 Jul 1997 ......
metaÊÇÓÃÀ´ÔÚHTMLÎĵµÖÐÄ£ÄâHTTPÐÒéµÄÏìӦͷ±¨ÎÄ¡£meta
±êÇ©ÓÃÓÚÍøÒ³µÄ<head>Óë</head>ÖУ¬meta ±êÇ©µÄÓô¦ºÜ¶à¡£meta
µÄÊôÐÔÓÐÁ½ÖÖ£ºnameºÍhttp-equiv¡£nameÊôÐÔÖ÷ÒªÓÃÓÚÃèÊöÍøÒ³£¬¶ÔÓ¦ÓÚcontent£¨ÍøÒ³ÄÚÈÝ£©£¬ÒÔ±ãÓÚËÑË÷ÒýÇæ»úÆ÷È˲éÕÒ¡¢·ÖÀࣨĿ
Ç°¼¸ºõËùÓеÄËÑË÷ÒýÇ涼ʹÓÃÍøÉÏ»úÆ÷ÈË×Ô¶¯²éÕ ......
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta NAME="Copyright" CONTENT="">
<meta http-equiv="Content-Type" content="text/html; charset=u ......
×Ô´ÓÓÃÁË ASP.Net MVCºó¾Íϲ»¶ÉÏÁËËü £¬ÒòΪMVC¶Ô·þÎñÆ÷¿Ø¼þµÄÒÀÀµ´ó´ó¼õÉÙ£¬ËüÉú³ÉµÄHTMLÒ³Ãæ¾Í±ÈWebFormÇåˬ¶àÁË£¬¼ÓÔØËÙ¶ÈÓÐÁËÃ÷ÏԵĸÄÉÆ¡£
µ«¶ÔÓÚÒ³ÃæÖÐÄÚǶscript£¬»¹ÊDz»Äܳ¹µ×µÄ±ÜÃ⣬È磺
<script type="text/javascript" language="javascript">
//<!--
function DepositPa ......