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()…………
Ïà¹ØÎĵµ£º
1¡¢ÐèҪ׼±¸µÄÈí¼þ£¨Èí¼þû·¨ÉÏ´«Ö»ºÃ·¢µØÖ·£©
£¨1£©jdk1.6
£¨2£©TOMCAT 5.5»òTOMCAT 6.0
2¡¢ÏȰ²×°jdk1.6£¬Ä¬Èϰ²×°¼´¿É£¬°²×°Íêºó£¬µã“¿ªÊ¼” -- “ÔËÐД£¬ÊäÈëcmdÈ·¶¨£¬½øÈëÃüÁî¿ò£¬ÊäÈë“java -version”£¬»Ø³µ£¬¾Í»á³öÀ´javaµÄ ......
ÈçºÎÖªµÀ²»Ê¶±ðÁËÄØ£¿
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 ......
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()ÎÞ·¨Öض ......
//ÔËÐÐͼ:
//Á¬½Ó×Ö·û´®
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 ......