JSPÖÐÒ³Ãæ×Ô¶¯¶¨Ê±Ë¢ÐÂ
1.JSPÖÐÒ³Ã涨ʱˢÐÂ
Java
´úÂë < type="application/x-shockwave-flash" width="14" height="15" src="http://penghuaiyi.javaeye.com/javascripts/syntaxhighlighter/clipboard_new.swf" src="http://penghuaiyi.javaeye.com/javascripts/syntaxhighlighter/clipboard_new.swf" flashvars="clipboard=%3C%25%0A%20%20%20%2F%2F%E9%A1%B5%E9%9D%A2%E6%AF%8F%E9%9A%9430%E7%A7%92%E8%87%AA%E5%8A%A8%E5%88%B7%E6%96%B0%E4%B8%80%E9%81%8D%20%20%20%20%0A%20%20%20response.setHeader(%22refresh%22%2C%2230%22)%3B%0A%25%3E%0A" quality="high" allowscriptaccess="always" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" height="15" width="14">
<%
//Ò³Ãæÿ¸ô30Ãë×Ô¶¯Ë¢ÐÂÒ»±é
response.setHeader("refresh"
,
"30"
);
%>
<%
//Ò³Ãæÿ¸ô30Ãë×Ô¶¯Ë¢ÐÂÒ»±é
response.setHeader("refresh","30");
%>
2.JSPÖÐÒ³Ã涨ʱˢÐÂÖÁÁíÒ»¸öÖ¸¶¨Ò³Ãæ
Java
´úÂë < type="application/x-shockwave-flash" width="14" height="15" src="http://penghuaiyi.javaeye.com/javascripts/syntaxhighlighter/clipboard_new.swf" src="http://penghuaiyi.javaeye.com/javascripts/syntaxhighlighter/clipboard_new.swf" flashvars="clipboard=%3C%25%0A%20%20%20%20%2F%2F%E9%A1%B5%E9%9D%A2%E6%AF%8F%E9%9A%9430%E7%A7%92%E8%87%AA%E5%8A%A8%E9%93%BE%E6%8E%A5%E8%87%B3%E5%8F%A6%E4%B8%80%E9%A1%B5%E9%9D%A2%0A%20%20%20%20response.setHeader(%22refresh%22%2C%2230%3BURL%3Dhttp%3A%2F%2Fwww.sina.com%22)%3B%0A%25%3E%0A%0A%0A" quality="high" allowscriptaccess="always" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" height="15" width="14">
<%
//Ò³Ãæÿ¸ô30Ãë×Ô¶¯Á´½ÓÖÁÁíÒ»Ò³Ãæ
response.setHeader("refresh"
,
"30;URL=http://www.sina.com"
);
%>
<%
//Ò³Ãæÿ¸ô30Ãë×Ô¶¯Á´½ÓÖÁÁíÒ»Ò³Ãæ
respo
Ïà¹ØÎĵµ£º
Ä¿Ç°ÔÚInternetÉϹ㷺ʹÓõĺǫ́¼¼ÊõÖÖÀà·±¶à£¬Ó¦ÓñȽϹ㷺µÄÓÐCGI£¬ASP£¬PHP£¬JSP/JavaServlet£¬ColdFusionµÈ¡£ÔÚÕâÒ»½ÚÀÖ÷Òª½éÉܼ¸ÖÖÔÚ¹úÄÚÓ¦ÓñȽϹ㷺µÄºǫ́ÓïÑÔ¡£
¡¡¡¡CGI£¬È«³ÆΪCommon Gateway Interface
¡¡¡¡CGI¾ÍÊǹ«¹²Íø¹Ø½Ó¿Ú (Common Gateway Interface) µÄËõд¡£ËüÊÇ×îÔç±»ÓÃÀ´½¨Á¢¶¯Ì¬ÍøÕ¾µÄºǫ́¼¼Êõ ......
ÏÖÔÚÓкöà³õѧjspµÄÍøÓѾ³£»áÎÊÊý¾Ý¿âÔõôÁ¬½Ó°¡£¬ÔõôÀϳö´í°¡£¿ËùÒÔÎÒ¼¯ÖеÄÔÚÕâдƪÎÄÕ¹©´ó¼Ò²Î¿¼£¬ÆäʵÕâÖÖ°ÑÊý¾Ý¿âÂ߼ȫ²¿·ÅÔÚjspÀïδ±ØÊǺõÄ×ö·¨£¬µ«ÊÇÓÐÀûÓÚ³õѧÕßѧϰ£¬ËùÒÔÎÒ¾ÍÕâÑù×öÁË£¬µ±´ó¼Òѧµ½Ò»¶¨³Ì¶ÈµÄʱºò£¬¿ÉÒÔ¿¼ÂÇÓÃMVCµÄģʽ¿ª·¢¡£ÔÚÁ·Ï°ÕâЩ´úÂëµÄʱºò£¬ÄãÒ»¶¨½«jdbcµÄÇý¶¯³ÌÐò·Åµ½·þÎñÆ÷µÄÀà·¾ ......
ÔÚJSPÖй²ÏíÊý¾Ý£¬´óÌå·ÖΪ2ÖÐÇé¿ö¡£Ò»ÊÇÔÚͬһ¸öÓû§µÄ²»Í¬Ò³ÃæÖ®¼ä¹²ÏíÊý¾Ý£¬¶þÊÇÔÚ²»Í¬µÄÓû§Ö®¼ä¹²ÏíÊý¾Ý.
¶ÔÓÚͬһ¸öÓû§µÄ»á»°£¬ÒªÏëÔÚ²»Í¬µÄÒ³ÃæÖ®¼ä¹²ÏíÊý¾Ý£¬¿ÉÓÐÒÔϼ¸ÖÖÑ¡Ôñ
¡ñ°ÑÊý¾Ý±£´æÔÚSessionÖУ¨ÕâÊǷdz£³£¼ûµÄ·½Ê½£©¡£
¡ñͨ¹ýCookie.
¡ñͨ¹ýÒþº¬µÄ±íµ¥°ÑÊý¾Ý´«µ½ÏÂÒ»¸öÒ³Ãæ¡£
¡ñͨ¹ýServletContext¶ ......
//ÏÂÃ棬´ÓÇëÇóÖеõ½ÊôÐÔ ÎªÒ»¸ö À࣬£¬»áÅжÏÊÇ·ñΪnull£¬£¬ÈçΪnullÔòʵÀý»¯
// id Öµ Ï൱ÓÚ class µÄ ¶ÔÏóÃû
<jsp:useBean id="order" class="com.entity.Order" scope="request" />
<==>
<%
Order order=(Order)request.getAttribute("order");
if(order==null)
  ......
ÔÚµ±Ç°Ó¦ÓÃϵͳµÄweb.xmlÀï¼ÓÈëjsp-config´úÂ룺
<web-app xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd" version="2.4">
<jsp-config>
< ......