Ò׽ؽØͼÈí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

jspÂÒÂëÎÊÌâ

  ѧϰjspʱ£¬ÂÒÂëÒ²ÊÇÒ»¸öºÜÍ·Í´µÄÊ¡£
1.ÔÚjspÎļþ¿ªÍ·¼ÓÉÏ<%@ page contentType="text/html; charset=GBK"%>
2.½â¾öpost·½Ê½Ìá½»ÄÚÈݵÄÂÒÂ룺request.setCharcterEncoding("GBK");
3.½â¾öurl(get£¬³¬Á´½Ó)·½Ê½ÂÒÂëÎÊÌâÊÇÅäÖÃservlet.xml.ÔÚ<Connector>±êÇ©ÖÐÌí¼ÓÒ»¾äURIEncoding="GBK" »òÕß string s=new String(´«¹ýÀ´µÄ×Ö¶Î.getBytes("ISO-8859-1"),"GBK");
4.´Óweb.xmlÅäÖÃÐÅÏ¢ÖÐÈ¡ÖÐÎÄÂÒÂë,string s=this.getServletConfig().getServletName();
   s= new String(s.getBytes("UTF_8"),"gbk");


Ïà¹ØÎĵµ£º

ÔÚJSPÖÐÓÃObject¶ÔÏóÀ´´«µÝÖµ

JavaScript´úÂ룺
          //°ìÊ´¦³éÈ¡±ÈÀý¸Ä±ä£¬¸üÐÂÆäËûÊý¾Ý
....function changeOfficeSampleScale(obj,flushOfficeRow){
 var row=obj.parentNode.parentNode;  //È¡µÃËùÔÚÐÐ
 var officeCode=row.id; //È¡µÃÐеÄId
 
 if(i ......

jspºÍservletÖض¨Ïò

 Ò»¡¢        
         ÔÚÒ»¸öÉè¼ÆÁ¼ºÃµÄWebÓ¦ÓÃÖУ¬¶¼»á×ÛºÏʹÓÃServletºÍJSP¼¼Êõ¡£Servlet¿ØÖÆÒµÎñÁ÷ת£¬JSPÔò¸ºÔðÒµÎñ´¦Àí½á¹ûµÄÏÔʾ¡£´Ëʱ£¬½«´óÁ¿Óõ½Öض¨Ïò¼¼Êõ¡£
¡¡¡¡Öض¨Ïò¼¼Êõ¿ÉÒÔ·ÖΪÁ½À࣬һÀàÊÇ¿Í»§¶ËÖض¨Ïò£¬Ò ......

ÔÚWEB£­INFÏÂʵÏÖjspÒ³ÃæµÄÌøת

²»Ëµ·Ï»°ÁË£¬¿´ÏÂÃæµÄÀý×Ó°É(ÀûÓÃstructsʵÏÖ£©£º
ÔÚWEB£­INFÏÂÓÐÁ½¸öÒ³Ã棺 a.jsp  ºÍ  b.jsp   £¬  ÏÖÔÚҪʵÏÖ´Óa.jspÁ¬½Óµ½b.jsp
ÔÚa.jspÖУº
                    <html:link action= ......

ÎåÖÖJSPÒ³ÃæÌøת·½·¨Ïê½â(1)

1. RequestDispatcher.forward()
ÊÇÔÚ·þÎñÆ÷¶ËÆð×÷ÓÃ,µ±Ê¹ÓÃforward()ʱ,Servlet engine´«µÝHTTPÇëÇó´Óµ±Ç°µÄServlet or JSPµ½ÁíÍâÒ»¸öServlet,JSP »òÆÕͨHTMLÎļþ,Ò²¼´ÄãµÄformÌá½»ÖÁa.jsp,ÔÚa.jspÓõ½ÁËforward()Öض¨ÏòÖÁb.jsp,´ËʱformÌá½»µÄËùÓÐÐÅÏ¢ÔÚ b.jsp¶¼¿ÉÒÔ»ñµÃ,²ÎÊý×Ô¶¯´«µÝ. µ«forward()ÎÞ·¨Öض¨ÏòÖÁÓÐframeµ ......

°ÑJSP·Åµ½WEB INFºóÒÔ±£»¤JSPÔ´´úÂë

    °ÑÄÇЩÏÞÖÆ·ÃÎʵÄ×ÊÔ´£¨±ÈÈç˵jspÔ´´úÂ룩·Åµ½WebÓ¦ÓõÄWEB-INFĿ¼Ï£¬¶ÔÓÚ/web-INF/¼°Æä×ÓĿ¼£¬²»ÔÊÐíÖ±½ÓµÄ¹«¹²·ÃÎÊ£¬ËùÒԾͿÉÒÔÆðµ½±£»¤ÕâЩ´úÂëδ¾­ÊÚȨµÄ·ÃÎʺͿúÊÓ£¬¸üºÃµÄ±£»¤ÁËÔ´´úÂë¡£
    ͨ³£JSP¿ª·¢ÈËÔ±»á°ÑËûÃǵÄÒ³ÃæÎļþ´æ·ÅÔÚWebÓ¦ÓÃÏàÓ¦µÄ×ÓĿ¼Ï¡£ÕâÖÖ·½·¨µÄÎÊÌâÊÇ ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ