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

jspµÄÄÚÖöÔÏó¡¢¹¦ÄÜÒÔ¼°Ö÷Òª·½·¨

jspµÄÄÚÖöÔÏó¡¢¹¦ÄÜÒÔ¼°Ö÷Òª·½·¨
JspÄÚÖöÔÏó ¹¦ÄÜ Ö÷Òª·½·¨
out  Ïò¿Í»§¶ËÊä³öÊý¾Ý print() println() flush() clear() isAutoFlush() getBufferSize()   close() …………
request Ïò¿Í»§¶ËÇëÇóÊý¾Ý getAttributeNames() getCookies() getParameter() getParameterValues() setAttribute() getServletPath() …………..
response ·â×°ÁËjsp²úÉúµÄÏìÓ¦£¬È»ºó±»·¢Ë͵½¿Í»§¶ËÒÔÏìÓ¦¿Í»§µÄÇëÇó addCookie() sendRedirect() setContentType()
flushBuffer() getBufferSize() getOutputStream()
sendError() containsHeader()……………
application  
config ±íʾServletµÄÅäÖ㬵±Ò»¸öServlet³õʼ»¯Ê±£¬ÈÝÆ÷°ÑijЩÐÅϢͨ¹ý´Ë¶ÔÏ󴫵ݸøÕâ¸öServlet getServletContext() getServletName() getInitParameter()   getInitParameterNames()……………
page JspʵÏÖÀàµÄʵÀý£¬ËüÊÇjsp±¾Éí£¬Í¨¹ýÕâ¸ö¿ÉÒÔ¶ÔËü½øÐзÃÎÊ flush()………
pagecontext ΪJSPÒ³Ãæ°ü×°Ò³ÃæµÄÉÏÏÂÎÄ¡£¹ÜÀí¶ÔÊôÓÚJSPÖÐÌØÊâ¿É¼û²¿·ÖÖмº¾­ÃüÃû¶ÔÏóµÄ¸ÃÎÊ forward() getAttribute() getException() getRequest() getResponse()   getServletConfig()
getSession() getServletContext() setAttribute()
removeAttribute() findAttribute() …………… 
session ÓÃÀ´±£´æÃ¿¸öÓû§µÄÐÅÏ¢£¬ÒÔ±ã¸ú×Ùÿ¸öÓû§µÄ²Ù×÷״̬ getAttribute() getId()   getAttributeNames() getCreateTime() getMaxInactiveInterval()
invalidate() isNew()
exception ·´Ó³ÔËÐеÄÒì³£ getMessage()…………


Ïà¹ØÎĵµ£º

jsp»·¾³ÅäÖÃ

1¡¢ÐèҪ׼±¸µÄÈí¼þ£¨Èí¼þû·¨ÉÏ´«Ö»ºÃ·¢µØÖ·£©
     £¨1£©jdk1.6
     £¨2£©TOMCAT 5.5»òTOMCAT 6.0
2¡¢ÏȰ²×°jdk1.6£¬Ä¬Èϰ²×°¼´¿É£¬°²×°Íêºó£¬µã“¿ªÊ¼” -- “ÔËÐД£¬ÊäÈëcmdÈ·¶¨£¬½øÈëÃüÁî¿ò£¬ÊäÈë“java -version”£¬»Ø³µ£¬¾Í»á³öÀ´javaµÄ ......

MyEclipse²»Ê¶±ðjspÒ³ÃæÖеÄhtml±ê¼Ç£¿

ÈçºÎÖªµÀ²»Ê¶±ðÁËÄØ£¿
MyEclipse--window--Preperences--MyEclipse--Files and Editors--XML--XML Catalog(Èô³öÏÖºìÉ«µÄ²æºÅ±íʾXMLʶ±ð²»ÁË)£»
н¨user_catalog.xml
£¨ÆäÖÐI:/Eclipse/CommonPlugins/DTD/ Ŀ¼Ï·ÅÖø÷ÖÖ´ÓÍøÉÏÏÂÔØµÄdtdÎļþ£©
ÈçÏëÌí¼ÓеÄdtdÎļþ£¬Ð޸ĴËÅäÖÃÎļþ¼´¿É¡£
<?xml version="1.0" en ......

JSP/ServletµÄURLÖØ¶¨Ïò

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()ÎÞ·¨Öض ......

´¿JSP·ÖÒ³´úÂëÖ®Mysql

//ÔËÐÐͼ:
//Á¬½Ó×Ö·û´®
String url="jdbc:mysql://localhost/"+dbName+"?user="+userName+"&password="+userPasswd;
Class.forName(driverName).newInstance();
Connection connection=DriverManager.getConnection(url);
Statement statement = connection.createStatement();
//ÿҳÏÔʾ¼Ç¼Êý
int PageSize ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØÍ¼ | ¸ÓICP±¸09004571ºÅ