jsp:forward±êÇ©
jsp:forward±êÇ©ÓÃÓÚ½«µ±Ç°µÄJspÒ³ÃæÌøתµ½ÁíÒ»¸öÒ³ÃæÉÏ£¬¸ÃÖ¸ÁîÖ»ÄÜʵÏÖ±¾ÍøÕ¾µÄÌøת
1.ÌøתµÄÒ³ÃæΪ¾²Ì¬Ò³ÃæʱµÄ¸ñʽ£º
<jsp:forward page="ÌøתµÄ¾²Ì¬Ò³ÃæÎļþÃû" />
2.ÌøתµÄÒ³ÃæΪ¶¯Ì¬Ò³ÃæʱµÄ¸ñʽ
<jsp:forward page="ÌøתµÄ¶¯Ì¬Ò³ÃæÎļþÃû">
<jsp:param name=? value=? />
...... ......
</jsp:forward>
Ïà¹ØÎĵµ£º
public static List getPageUser(int currentPage) throws Exception {//?List
Connection conn = null;
PreparedStatement prep = null;
ResultSet rs = null ......
ÔÚJSPºÍServletÖÐÓм¸¸öµØ·½¶¼¿ÉÒÔÉèÖñàÂ룬¸÷¸ö±àÂëµÄ¹¦ÄÜÒ²²»Ò»Ñù£¬±¾ÎĽ«¶Ô¸÷¸ö±àÂë×öÒ»¸öС½á¡£
¸÷ÖÖ±àÂëÒ»ÀÀ
A. JSP/Servlet¶¼ÓеıàÂëÉèÖÃ
1. request.setCharacterEncoding("UTF-8")
2. response.setCharacterEncoding("UTF-8")
3. response.setContentType("text/html;
charset=U ......
ÎÒ°Ñindex.jspÎļþ·Åµ½WEB-INFÏ£¬ÓÖÔÚWEB-INFϽ¨Á¢Ò»¸öĿ¼jsÓÃÀ´·ÅjavascriptÎļþ£¬Ò²¾ÍÊÇ˵index.jspºÍjsĿ¼ÊÇƽ¼¶µÄ£¬µ«ÊÇÔÚindex.jspÏÂÒýÓÃjavascriptÎļþʱÔõôҲÕÒ²»µ½¡£
WEB-INF¶ÔÓÚÓû§£¨Ò²¾ÍÊÇIE£©²»¿É¼û¡£
¶Ô²ß£¬°Ñjs·Åµ½WEB-INFÍ⣬»òÕßͨ¹ýרÃŵÄjsp/servlet/actionµÈforwardµ½ÏàÓ¦µÄ×ÊÔ´¡£ ......
¸Ã±êÇ©ÓÃÓÚÏòÄ¿±êÒ³ÃæÖеIJÎÊý´«Öµ£¬¸Ã±êǩͨ³£Óëjsp:include»òjsp:forward±êÇ©Ò»ÆðʹÓÃ
¸ñʽ£º<jsp:param name=? value=? />
name£ºÄ¿±êÒ³ÃæÖеÄij²ÎÊýÃû
value£ºÏònameÖ¸¶¨µÄ²ÎÊýËù´«µÄÖµ
Ò»¸öÒ³ÃæÖпÉÒÔÊ ......