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

JSPµÄÄÚÖöÔÏó¼°·½·¨

request request±íʾHttpServletRequest¶ÔÏó¡£Ëü°üº¬ÁËÓйØä¯ÀÀÆ÷ÇëÇóµÄÐÅÏ¢£¬²¢ÇÒÌṩÁ˼¸¸öÓÃÓÚ»ñÈ¡cookie, header, ºÍsessionÊý¾ÝµÄÓÐÓõķ½·¨¡£
response response±íʾHttpServletResponse¶ÔÏ󣬲¢ÌṩÁ˼¸¸öÓÃÓÚÉèÖÃËÍ»Ø ä¯ÀÀÆ÷µÄÏìÓ¦µÄ·½·¨£¨Èçcookies,Í·ÐÅÏ¢µÈ£©
out out ¶ÔÏóÊÇjavax.jsp.JspWriterµÄÒ»¸öʵÀý£¬²¢ÌṩÁ˼¸¸ö·½·¨Ê¹ÄãÄÜÓÃÓÚÏòä¯ÀÀÆ÷»ØËÍÊä³ö½á¹û¡£
pageContext pageContext±íʾһ¸öjavax.servlet.jsp.PageContext¶ÔÏó¡£ËüÊÇÓÃÓÚ·½±ã´æÈ¡¸÷ÖÖ·¶Î§µÄÃû×ֿռ䡢servletÏà¹ØµÄ¶ÔÏóµÄAPI£¬²¢ÇÒ°ü×°ÁËͨÓõÄservletÏà¹Ø¹¦Äܵķ½·¨¡£
session session±íʾһ¸öÇëÇóµÄjavax.servlet.http.HttpSession¶ÔÏó¡£Session¿ÉÒÔ´æÖüÓû§µÄ״̬ÐÅÏ¢
application applicaton ±íʾһ¸öjavax.servle.ServletContext¶ÔÏó¡£ÕâÓÐÖúÓÚ²éÕÒÓйØservletÒýÇæºÍservlet»·¾³µÄÐÅÏ¢
config config±íʾһ¸öjavax.servlet.ServletConfig¶ÔÏ󡣸öÔÏóÓÃÓÚ´æÈ¡servletʵÀýµÄ³õʼ»¯²ÎÊý¡£
page page±íʾ´Ó¸ÃÒ³Ãæ²úÉúµÄÒ»¸öservletʵÀý
 


Ïà¹ØÎĵµ£º

Douyu»áÊÇSSH¹¹¼ÜÓëJSP/Servlet¼¼ÊõµÄÖÕ½áÕßÂð?

 DouyuÊÇÒ»ÖÖÍêÈ«²ÉÈ¡JavaÓïÑÔ¿ª·¢µÄ¡¢ÔË×÷ÓÚJVMÒÔÉϵÄÐÂʽ»ù´¡¿ª·¢Æ½Ì¨¡£
ÔÚweb²ã£¬DouyuÍêÈ«ÒÅÆúÁËJSP/Servlet£¬
ÔÚÊý¾Ý¿â·ÃÎʲ㣬Douyu²»ÒÀÀµÓÚÈκÎORM(¶ÔÏñ¹ØϵÕÕÉä)¹¹¼Ü(ÈçHibernate)¡£
Douyu½«JavaÓïÑÔ±àÒëÆ÷¡¢Http·þÎñÆ÷¡¢MVCÔ²Âúµ÷ÕûÔÚÒ»Æð£¬
²îµã¶ù¶ÒÏÖÁËORMÈ«×Ô¶¯»¯£¬Í¬Ê±ÔÚJavaÓïÑÔ²ãÃæÒý³öÁËȨÏÞÖ ......

jspÖеÄÔªËصÄidÖµºÍnameÖµ£¬ÔÚieºÍffÖеÄÇø±ð

document.getElementById("flag")ÔÚieÖУ¬jspÖеÄÔªËØûÓÐidÖµ£¬ÓÐnameֵʱ£¬Ò²Äܲé³öÀ´£¬°´ÕÕnameÖµ²é¡£
µ«ÊÇÔÚfirefoxÖУ¬Èç¹ûûÓÐidÖµ£¬Ôò²é²»³öÀ´¡£ËùÒÔieÖУ¬nameºÍidÓÐʱͨÓ㻵«ÊÇfirefoxÖУ¬ÊÇÓÐÕâÑϸñÇø±ðµÄ¡£ ......

JSP Standard Tag Libraries ʵ¼ùÀí½â

 ÔÚ±¾ÆªÎÄÕÂÖÐ,ÎÒÃǽ«»áÉîÈëÁ˽âÔÚ²»Í¬µÄTag LibraryÃèÊö·û(Tag Library Descriptors:TLDs)ÖÐʹÓø÷ÖÖ²»Í¬µÄtagµÄÇé¿ö.ÎÒÃǽ«»áÒÀ´ÎÑо¿ Ìõ¼þ¡¢Ñ­»·¡¢URL¡¢U18N¡¢XMLµÈtagµÄÓ÷¨¡£ÒÔ´ËÀ´Ìá¸ßÄã¶ÔJSTLµÄÈÏʶºÍÓ¦ÓÃÄÜÁ¦,ÔÚÔĶÁ±¾ÎÄÇ°£¬ÄãÓ¦¸Ã¶Ô JSP Tag LibÓÐËùÁ˽⣬²¢ÇåÎúÓйØJSTL£¨JSP Standard Tag Libraries£©µÄ»ù± ......

jsp/servletÖеĹýÂËÆ÷FilterÅäÖÃ×ܽá

ÔÚJava web¿ª·¢Öг£»áʹÓõ½¹¦ÄÜÇ¿´óµÄ¹ýÂËÆ÷£¬Ëû±Ï¾¹ÄܸøÎÒÃÇ´øÀ´ºÜ´óµÄ·½±ã£¬µ«ÊÇÕë¶Ô¹ýÂ˵Ä×ÊÔ´ÎÒÃÇÐèÒªÏêϸµÄÁ˽âËûÃÇÔÚweb.xmlÖеÄÅäÖÃÐÅÏ¢¡£Õâ¸ö¸ù¾Ý¼¸ÖÖ³£ÓõIJ»Í¬Çé¿ö½øÐÐÁË×ܽ᣺
1.Èç¹ûÒªÓ³Éä¹ýÂËÓ¦ÓóÌÐòÖÐËùÓÐ×ÊÔ´£º
<filter>
    <filter-name>loggerfilter</filter-name> ......

JSP+MySqlµÄʱ¼ä´¦Àí

ºÜ¾ÃûÓÐÓÃMysqlÁË£¬·¢ÏÖССµÄʱ¼äÎÊÌâÒ²Óöµ½²»ÉÙÂé·³£¬ºÇºÇ
ËùÒÔ×ܽáһϣº
µÚÒ»ÖÖ:
Date time= new java.sql.Date(new java.util.Date().getTime());
µÚ¶þÖÖ:
java ÓÃPreparedStatementÀ´setDate,ÓÃÎʺŵÄÐÎʽ¸øÈÕÆÚÎʺŸ³Öµ
pstmt.setTimestamp(8, new Timestamp(System.currentTimeMillis()));  
pst ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ