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

JSP¾Å´óÄÚÖöÔÏó¼°Ëĸö×÷ÓÃÓò

¾Å´ó¶ÔÏó£º
ÄÚÖöÔÏó£¨ÓÖ½ÐÒþº¬¶ÔÏó£¬ÓÐ9¸öÄÚÖöÔÏó£©:²»ÐèÒªÔ¤ÏÈÉùÃ÷¾Í¿ÉÒÔÔڽű¾´úÂëºÍ±í´ïʽÖÐËæÒâʹÓÃ
1-out:
 javax.servlet.jsp.JspWriterÀàÐÍ£¬´ú±íÊä³öÁ÷µÄ¶ÔÏó¡£×÷ÓÃÓòΪpage£¨Ò³ÃæÖ´ÐÐÆÚ£©
request£ºjavax.servlet.ServletRequestµÄ×ÓÀàÐÍ£¬´Ë¶ÔÏó·â×°ÁËÓÉWEBä¯ÀÀÆ÷»òÆäËü¿Í»§¶ËÉú³ÉµØHTTP
ÇëÇóµÄϸ½Ú£¨²ÎÊý£¬ÊôÐÔ£¬Í·±êºÍÊý¾Ý£©¡£×÷ÓÃÓòΪrequest(Óû§ÇëÇóÆÚ£©¡£
·½·¨Óɿɲ鿴API
response£ºjavax.servlet.ServletResponseµÄ×ÓÀàÐÍ£¬´Ë¶ÔÏó·â×°ÁË·µ»Øµ½HTTP¿Í»§¶ËµÄÊä³ö£¬ÏòÒ³Ãæ
×÷ÕßÌṩÉèÖÃÏìӦͷ±êºÍ״̬ÂëµÄ·½Ê½¡£¾­³£ÓÃÀ´ÉèÖÃHTTP±êÌ⣬Ìí¼Ócookie£¬ÉèÖÃÏìÓ¦ÄÚÈݵÄÀàÐͺÍ×´
̬£¬·¢ËÍHTTPÖض¨ÏòºÍ±àÂëURL¡£×÷ÓÃÓòΪpage£¨Ò³ÃæÖ´ÐÐÆÚ£©¡£
pageContext£ºjavax.servlet.jsp.PageContext£¨³éÏóÀࣩÀàÐÍ£¬×÷ÓÃÓòΪpage£¨Ò³ÃæÖ´ÐÐÆÚ£©¡£´Ë¶ÔÏó
ÌṩËùÓÐËĸö×÷ÓÃÓò²ã´ÎµÄÊôÐÔ²éѯºÍÐÞ¸ÄÄÜÁ¦£¬ËüÒ²ÌṩÁËת·¢ÇëÇóµ½ÆäËü×ÊÔ´ºÍ°üº¬ÆäËû×ÊÔ´µÄ·½·¨
£º
¸Ã¶ÔÏóµÄ·½·¨¶¼ÊdzéÏó·½·¨
session£ºjavax.servlet.http.HttpSessionÀàÐÍ£¬Ö÷ÒªÓÃÓÚ¸ú×Ù¶Ô»°¡£×÷ÓÃÓòsession(»á»°ÆÚ—£©¡£
HttpSessionÊÇÒ»¸öÀàËƹþÏ£±íµÄÓëµ¥Ò»WEBä¯ÀÀÆ÷»á»°Ïà¹ØµÄ¶ÔÏó£¬Ëü´æÔÚÓÚHTTPÇëÇóÖ®¼ä£¬¿ÉÒÔ´æ´¢ÈÎ
ºÎÀàÐ͵ÄÃüÃû¶ÔÏó¡£
Èç¹û²»ÐèÒªÔÚÇëÇóÖ®¼ä¸ú×ٻỰ¶ÔÏ󣬿ÉÒÔͨ¹ýÔÚpageÖ¸ÁîÖÐÖ¸¶¨session="false"
ÐèÒª¼ÇסµÄÊÇpageContext¶ÔÏóÒ²¿ÉÒÔÓësession.getAttribute(),session.setAttribute()Ò»ÑùµÄ·½Ê½È¡
µÃ²¢ÉèÖûỰÊôÐÔ¡£
application£ºjavax.servlet.ServletContextÀàÐÍ£¬servletµÄ»·¾³Í¨¹ýµ÷ÓÃgetServletConfig
().getContext()·½·¨»ñµÃ¡£×÷ÓÃÓòÊÇapplication(Õû¸ö³ÌÐòÔËÐÐÆÚ£©¡£ËüÌṩÁ˹ØÓÚ·þÎñÆ÷°æ±¾£¬Ó¦ÓÃ
¼¶³õʼ»¯²ÎÊýºÍÓ¦ÓÃÄÚ×ÊÔ´¾ø¶Ô·¾¶£¬×¢²áÐÅÏ¢µÄ·½Ê½
config£ºjavax.servlet.ServletConfig,×÷ÓÃÓòΪpage£¨Ò³ÃæÖ´ÐÐÆÚ£©
exception:java.lang.Throwable,ͨ¹ýJSP´íÎóÒ³ÃæÖÐÒ»¸öcatch¿éÒѾ­Òæ³öµ«Ã»ÓⶻñµÄ
java.lang.ThrowableµÄÈÎÒâʵÀý£¬´«ÏòÁËerrorPageµÄURI¡£×÷ÓÃÓòΪpage£¨Ò³ÃæÖ´ÐÐÆÚ£©¡£×¢Òâ
exceptionÖ»ÓÐÔÚpageÖ¸ÁîÖоßÓÐÊôÐÔisErrorPage="true"ʱ²ÅÓÐЧ¡£
page:java.lang.ObjectÀàÐÍ£¬Ö¸ÏòÒ³Ãæ×ÔÉíµÄ·½Ê½¡£×÷ÓÃÓòΪpage£¨Ò³ÃæÖ´ÐÐÆÚ
JSPÖоŴóÄÚÖöÔÏóΪ£º
request            ÇëÇó¶ÔÏó¡¡         &n


Ïà¹ØÎĵµ£º

ÓÃJspÊä³öWord,PDFµÈÎļþʱ½øÐеÄÉèÖÃ

response.setContentType( "application/pdf" ); // MIME type for pdf doc
response.setHeader("Content-Disposition","attachment;filename=output.pdf;");

 
Sets the Content-Type header. Content-Type identifies the MIME type of the response document and the character set encoding.
To se ......

JSPÈëÃÅ

JSP¿ª·¢ÈëÃÅ
 
¸ÅÊö£º
JSP(Java Server Pages)ÊÇÓÉSun Microsystems¹«Ë¾³«µ¼¡¢Ðí¶à¹«Ë¾²ÎÓëÒ»Æð½¨Á¢µÄÒ»ÖÖ¶¯Ì¬ÍøÒ³¼¼Êõ±ê×¼¡£JSP¼¼ÊõÓеãÀàËÆASP¼¼Êõ£¬ËüÊÇÔÚ´«Í³µÄÍøÒ³HTMLÎļþ(*.htm,*.html)ÖвåÈëJava³ÌÐò¶Î(Scriptlet)ºÍJSP ±ê¼Ç(tag)£¬´Ó¶øÐγÉJSPÎļþ(*.jsp)¡£ ÓÃJSP¿ª·¢µÄWebÓ¦ÓÃÊÇ¿çƽ̨µÄ£¬¼ÈÄÜÔÚLinuxÏÂÔ ......

½²½âJSP¹ýÂËÆ÷ºÍ¼àÌýÆ÷

     ¹ØÓÚÕâ¸öÎÊÌâ, ±È½Ï¸´ÔÓµÄ˵. ²»¹ýÎÒÏ£Íûͨ¹ýÀý×ÓÀ´½âÊͻ᷽±ãÀí½âһЩ.
¼ÙÉèÓÐÒ»¸ö·Ç³£Î£ÏÕµÄÈÎÎñ, ÊǾÅËÀÒ»Éú. ÐèÒªÄã´§×ÅÕ¨Ò©°ü´Ó±±Æ½¿ª³µ×߸ßËÙ·¹ý±£¶¨È¥Ê¯¼Òׯ°Ñ¹í×ӵĵﱤ¸øÕ¨ÁË. ×¢Òâ: Õâ¸öÈÎÎñÊ®·Ö¼è¾Þ, ÓпÉÄÜ°ë·ըҩ±¬Õ¨. ËùÒÔ³ö·¢Ç°ÄãÐèÒª¿àÁ·10ÔªÒ»±¾µÄ<<Ìú²¼ÉÀ>>, » ......

JUnitѧϰ±Ê¼Ç15 ¶ÔJSPºÍtaglib½øÐе¥Ôª²âÊÔ2

ʹÓÃCactus¶Ôtaglib½øÐе¥Ôª²âÊÔ ÏÂͼÃèÊöÁËʹÓÃCactus¶Ô±ê¼Ç¿âµÄÒ»¸ö±ê¼Ç½øÐе¥Ôª²âÊԵĹý³Ì¡£(ͼƬÁ´½Ó) 1.Cactus¶ÔÏó³õʼ»¯²âÊÔÀ࣬¸ÃÀà±ØÐëÅÉÉú×ÔJspTestCaseÀ࣬²âÊÔ±ê¼ÇʱËùÐèÒªµÄÈκÎHTTP²ÎÊý£¬¶¼ÐèÒªÔÚbeginXXX·½·¨ÖнøÐÐÅäÖá£ÀýÈ磬Èç¹ûij±ê¼Ç´ÓHttp²ÎÊýÌáÈ¡ÐÅÏ¢£¬ÄÇôÄãÐèÒªÔÚbeginXXX·½·¨Öж¨Òå¸Ã²ÎÊý¡£ ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ