jsp:forward±êÇ©ºÍresponse.sendRedirect()·½·¨µÄÇø±ð
ÔÚÍøÉÏ¿´µ½Ò»Ð©Ìû×Ó£¬×ܽáÁËһЩÇø±ð£¬¿ÉÒÔ´ÓÒÔϼ¸¸ö·½ÃæÀ´¿´£º
1.´ÓµØÖ·À¸ÏÔʾÀ´Ëµ
forwardÊÇ·þÎñÆ÷ÇëÇó×ÊÔ´,·þÎñÆ÷Ö±½Ó·ÃÎÊÄ¿±êµØÖ·µÄURL,°ÑÄǸöURLµÄÏìÓ¦ÄÚÈݶÁÈ¡¹ýÀ´,È»ºó°ÑÕâЩÄÚÈÝ
ÔÙ·¢¸øä¯ÀÀÆ÷.ä¯ÀÀÆ÷¸ù±¾²»ÖªµÀ·þÎñÆ÷·¢Ë͵ÄÄÚÈÝ´ÓÄÄÀïÀ´µÄ,ËùÒÔËüµÄµØÖ·À¸»¹ÊÇÔÀ´µÄµØÖ·.
redirectÊÇ·þÎñ¶Ë¸ù¾ÝÂß¼,·¢ËÍÒ»¸ö״̬Âë,¸æËßä¯ÀÀÆ÷ÖØÐÂÈ¥ÇëÇóÄǸöµØÖ·.ËùÒÔµØÖ·À¸ÏÔʾµÄÊÇеÄURL.Ëù
ÒÔredirectµÈÓÚ¿Í»§¶ËÏò·þÎñÆ÷¶Ë·¢³öÁ½´Îrequest£¬Í¬Ê±Ò²½ÓÊÜÁ½´Îresponse¡£
2.´ÓÊý¾Ý¹²ÏíÀ´Ëµ
forward:ת·¢Ò³ÃæºÍת·¢µ½µÄÒ³Ãæ¿ÉÒÔ¹²ÏírequestÀïÃæµÄÊý¾Ý.
redirect:²»Äܹ²ÏíÊý¾Ý.
redirect²»½ö¿ÉÒÔÖض¨Ïòµ½µ±Ç°Ó¦ÓóÌÐòµÄÆäËû×ÊÔ´,»¹¿ÉÒÔÖض¨Ïòµ½Í¬Ò»¸öÕ¾µãÉϵÄÆäËûÓ¦ÓóÌÐòÖеÄ×ÊÔ´,
ÉõÖÁÊÇʹÓþø¶ÔURLÖض¨Ïòµ½ÆäËûÕ¾µãµÄ×ÊÔ´.
forward,·½·¨Ö»ÄÜÔÚͬһ¸öWebÓ¦ÓóÌÐòÄÚµÄ×ÊÔ´Ö®¼äת·¢ÇëÇó.
forward ÊÇ·þÎñÆ÷ÄÚ²¿µÄÒ»ÖÖ²Ù×÷.
redirect ÊÇ·þÎñÆ÷֪ͨ¿Í»§¶Ë,Èÿͻ§¶ËÖØз¢ÆðÇëÇó.
ËùÒÔ,Äã¿ÉÒÔ˵ redirect ÊÇÒ»ÖÖ¼ä½ÓµÄÇëÇó, µ«ÊÇÄã²»ÄÜ˵"Ò»¸öÇëÇóÊÇÊôÓÚforward»¹ÊÇredirect "
3.´ÓÔËÓõط½À´Ëµ
forward:Ò»°ãÓÃÓÚÓû§µÇ½µÄʱºò,¸ù¾Ý½Çɫת·¢µ½ÏàÓ¦µÄÄ£¿é.
redirect:Ò»°ãÓÃÓÚÓû§×¢ÏúµÇ½ʱ·µ»ØÖ÷Ò³ÃæºÍÌøתµ½ÆäËüµÄÍøÕ¾µÈ.
4.´ÓЧÂÊÀ´Ëµ
forward:¸ß.
redirect:µÍ.
5.jsp Óï·¨
<jsp:forward page={"relativeurl" | "<%= expression %>"} />
»òÕßÕâÑùд£º
<jsp:forward page={"relativeurl" | "<%= expression %>"} >
<jsp:param name="parametername" value="{parametervalue | <%= expression %>}" />+
</jsp:forward>
6.Àý×Ó
<jsp:forward page="/servlet/login" />
<jsp:forward page="/servlet/login">
<jsp:param name="username" value="jsmith" />
</jsp:forward>
ÃèÊö
<jsp:forward>±êÇ©´ÓÒ»¸öjspÎļþÏòÁíÒ»¸öÎļþ´«µÝÒ»¸ö°üº¬Óû§ÇëÇóµÄrequest¶ÔÏó.<jsp:forward>±êÇ©ÒÔϵĴúÂ룬½«²»ÄÜÖ´ÐÐ.
ÄãÄܹ»ÏòÄ¿±êÎļþ´«ËͲÎÊýºÍÖµ£¬ÔÚÕâ¸öÀý×ÓÖÐÎÒÃÇ´«µÝµÄ²ÎÊýÃûΪusername,ֵΪscott,Èç¹ûÄãʹÓÃÁË<jsp:param>±êÇ©µÄ»°£¬Ä¿±êÎļþ±ØÐëÊÇÒ»¸ö¶¯Ì¬µÄÎļþ£¬Äܹ»´¦Àí²ÎÊý.
Èç¹ûÄãʹÓÃÁË·Ç»º³åÊä³öµÄ»°£¬ÄÇôʹÓÃ<jsp:forward>ʱ¾ÍҪСÐÄ¡£
Èç¹ûÔÚÄãʹÓÃ<jsp:forward>֮ǰ£¬jspÎļþÒѾÓÐÁËÊý¾Ý£¬ÄÇôÎļþÖ´Ðоͻá³ö´í.
ÊôÐÔ
Ïà¹ØÎĵµ£º
FCKeditor jsp ÅäÖà ʹÓÃ
2009-04-07 16:57
FCKeditorÊÇÒ»¿î¿çƽ̨µÄÔÚÏß±à¼Æ÷£¬µ½ÎÒ·¢²¼±¾ÎÄ£¬FCKeditorµÄ¹Ù·½°æ±¾ÒѾ·¢Õ¹µ½ÁË2.6.4
µã»÷½øÈë ¹ÙÍø
1¡¢Ê×Ïȵǽwww.fckeditor.net/downloadÏÂÔØFCKeditorµÄ×îа汾£¬ÐèÒªÏÂÔØ2¸öѹËõ°ü£¬Ò»¸öÊÇ»ù±¾Ó¦Óã¬ÁíÒ»¸öÊÇÔÚΪÔÚjspÏÂËù×¼±¸µÄÅäÖá£
  ......
ÎÒµÄϵͳʹÓÃacegiµÇ¼ÈÏÖ¤£¬²¢ÇÒÅäÖÃÓû§»º´æ
<!-- »º´æÆ÷,ΪuserCacheBackendÌṩ»º´æ¹ÜÀí¡£ -->
<bean id="cacheManager"
class="org.springframework.cache.ehcache.EhCacheManagerFactoryBean" />
<!-- EhCacheÒ»°ãÓÃ;ÈçÏ£ºHibernate»º´æ£¬DAO»º´æ£¬°²È«ÐÔƾ֤»º´æ£¨Ace ......
£±.×îÖ±½Ó×î¼òµ¥µÄ£¬·½Ê½ÊÇ°ÑÎļþµØÖ·Ö±½Ó·Åµ½htmlÒ³ÃæµÄÒ»¸öÁ´½ÓÖС£ÕâÑù×öµÄȱµãÊÇ°ÑÎļþÔÚ·þÎñÆ÷ÉϵÄ·¾¶±©Â¶ÁË£¬²¢ÇÒ»¹ÎÞ·¨¶ÔÎļþÏÂÔؽøÐÐÆäËüµÄ¿ØÖÆ£¨ÈçȨÏÞ£©¡£Õâ¸ö¾Í²»Ð´Ê¾ÀýÁË¡£
£².ÔÚ·þÎñÆ÷¶Ë°ÑÎļþת»»³ÉÊä³öÁ÷£¬Ð´Èëµ½response£¬ÒÔresponse°ÑÎļþ´øµ½ä¯ÀÀÆ÷£¬ÓÉä¯ÀÀÆ÷À´ÌáʾÓû§ÊÇ·ñÔ¸Òâ±£´æÎ ......
<%--
ÓÐЩÅóÓÑѯÎÊʹÓà JSP Smart ÏÂÔØÎļþµÄʱºò±¨´í, ÕâÀï¸ø³öÒ»¸ö²âÊÔ¹ýµÄ²»
ÐèҪʹÓà JSP Smart µÄ JSP Ò³ÃæÖнøÐÐÎļþÏÂÔصĴúÂë(¸Ä Servlet »òÕß
JavaBean µÄ»°×Ô¼º¸Ä°É), Ö§³ÖÖÐÎĸ½¼þÃû(×öÁËתÄÚÂë´¦Àí). ÊÂʵÉÏÖ»ÒªÏò ......
1.±ØÐë¼Ì³Ð×ÔHttpServlet
2.±ØÐëʵÏÖdoGet()»òÕßdoPost()
3.±ØÐëÔÚweb.xmlÖÐÅäÖÃServlet
<servlet>
<servlet-name> </servlet-name>
<servlet-class> </servlet-class>
</servlet>
<servlet-mapping>
......