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

JSP¾Å¸öÄÚÖöÔÏó

ѧϰJ2EE£¬±ØÐë¶ÔÏÂÃæµÄ¼¸¸ö¶ÔÏóÓкÜÉîµÄÀí½â
1¡¢request   ->  javax.servlet.http.HttpServletRequestµÄʵÀý
     ¸Ã¶ÔÏó·â×°ÁËÒ»´ÎÇëÇ󣬿ͻ§¶ËµÄÇëÇó²ÎÊý¶¼±»·â×°ÔڸöÔÏóÀï¡£ÕâÊÇÒ»¸ö³£ÓõĶÔÏ󣬻ñÈ¡¿Í»§¶ËÇëÇó²ÎÊý±ØÐëʹÓøöÔÏó¡£³£Óõķ½·¨ÓÐgetParameter(String paramName)¡¢getParameterValues(String paramName)¡¢setAttribute(String atttName,Object attrValue)¡¢getAttribute(String attrName)ºÍsetCharacterEncoding(String env)µÈ¡£
2¡¢response  ->   javax.servlet.http.HttpServletResponseµÄʵÀý
     ´ú±í·þÎñÆ÷¶Ô¿Í»§¶ËµÄÏìÓ¦¡£Í¨³£ºÜÉÙʹÓøöÔÏóÖ±½ÓÏìÓ¦£¬¶øÊÇʹÓÃout¶ÔÏ󣬳ý·ÇÐèÒªÉú³É·Ç×Ö·ûÏìÓ¦¡£¶øresponse¶ÔÏó³£ÓÃÓÚÖØ¶¨Ïò£¬³£Óõķ½·¨ÓÐgetOutputStream()¡¢sendRedirect(java.lang.String location)µÈ¡£
3¡¢session  ->    javax.servlet.http.HttpSessionµÄʵÀý
     ¸Ã¶ÔÏó´ú±íÒ»´Î»á»°¡£µ±¿Í»§¶Ëä¯ÀÀÆ÷ÓëÕ¾µã½¨Á¢Á¬½Óʱ£¬»á»°¿ªÊ¼£»µ±¿Í»§¶Ë¹Ø±Õä¯ÀÀÆ÷ʱ£¬»á»°½áÊø¡£³£Óõķ½·¨ÓУºgetAttribute(String attrName)¡¢setAttribute(String attrName, Object attrValue)µÈ¡£ÔÚÓû§µÇ¼´¦ÀíµÄʱºò¾­³£Ê¹ÓÃÕâ¸ö¶ÔÏó¡£
4¡¢pageContext  ->  javax.servlet.jsp.PageContextµÄʵÀý
     ¸Ã¶ÔÏó´ú±í¸ÃJSPÒ³ÃæÉÏÏÂÎÄ£¬Ê¹ÓøöÔÏó¿ÉÒÔ·ÃÎÊÒ³ÃæÖеĹ²ÏíÊý¾Ý¡£³£Óõķ½·¨ÓÐgetServletContext()ºÍgetServletConfig()µÈ¡£¾­³£ÔÚJspÖж¨ÒåһЩÊôÐÔ¾ÍÊDZ»·Å½øÕâ¸öʵÀýÖС£
5¡¢application  ->  javax.servlet.ServletContextµÄʵÀý
     ¸ÃʵÀý´ú±íJSPËùÊôµÄWebÓ¦Óñ¾Éí£¬¿ÉÓÃÓÚJSPÒ³Ãæ£¬»òÕßServletÖ®¼ä½»»»ÐÅÏ¢¡£³£Óõķ½·¨ÓÐgetAttribute(String attName)¡¢setAttribute(String attName , String attValue)ºÍgetInitParameter(String paramName)µÈ¡£
6¡¢config  ->  javax.servlet.ServletConfigµÄʵÀý
     ¸ÃʵÀý´ú±í¸ÃJSPµÄÅäÖÃÐÅÏ¢¡£³£Óõķ½·¨ÓÐgetInitParameter(String paramName)ºÍgetInitParameternames()µÈ·½·¨¡£ÊÂʵÉÏ£¬JSPÒ³ÃæÍ¨³£ÎÞÐëÅäÖã¬Ò²¾Í²»´æÔÚÅäÖÃÐÅÏ¢¡£Òò´Ë£¬¸Ã¶ÔÏ


Ïà¹ØÎĵµ£º

×鯴jsp·½·¨4

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE tiles-definitions PUBLIC
  "-//Apache Software Foundation//DTD Tiles Configuration//EN"
  "http://jakarta.apache.org/struts/dtds/tiles-config.dtd">
<tiles-definitions>
 <definition name="tscs.templet" path="/pa ......

JSPÁ¬½ÓMySqlÊý¾Ý¿â


Á¬Ðø¼¸Ìì°²×°ÅäÖúÍÁ¬½ÓMysqlÊý¾Ý¿â£¬½ñÌìÖÕÓڳɹ¦ÁË£¬»ØÏëÕ⼸Ìì£¬ÕæµÄÊÇÌðËá¿àÀ±¶¼ÓУ¬µ¥mysql¾Í֨װÁ˲»ÏÂ10´Î£¬¶øÔÚeclipseÉϱàдµÄÁ¬½ÓÊý¾Ý¿âµÄ³ÌÐò×ÜÊDZ¨´í£®ÎÒ¶¼ÒѾ­downÁËoracal×¼±¸·ÅÆúmysqlÁË£¬²»¹ý£®£®£®¾ÍÏóµçÊÓ¾çÑݵÄÄÇÑù£¬×ª»ú×ÜÊÇÔÚÕâ¸öʱºò³öÏÖ£¬ÏÈÊÇ¿´µ½ÁËsaulzy¹ØÓÚmysql4.1.11°æ±¾µÄ°²×°½éÉÜ£¬½Ó×ÅÓÖÕ ......

JSPÌø×ªµÄ¼¸ÖÖ·½Ê½|Struts¶¯Ì¬Ìø×ª

String url="http://www.baidu.com";
   ActionForward gotourl = new ActionForward(url);
   gotourl.setPath(url);
   gotourl.setRedirect(true);
   return gotourl;
  1.RequestDispatcher.forward()
¡¡¡¡ ÊÇÔÚ·þÎñÆ÷¶ËÆð×÷ÓÃ,µ±Ê¹ÓÃforward()ʱ,Servlet engine´ ......

MyEclipseÖÐÐÞ¸ÄĬÈÏJSP±à¼­Æ÷µÄ·½·¨.txt

      ÔÚMyEclipseÖпª·¢WEBÓ¦ÓÃʱ¾­³£Òª´´½¨JSPÎļþ£¬µ«ÊÇÿ´ÎMyEclipse¶¼»áÓÃĬÈϵÄMyEclipse Visual JSP Designer£¬´ò¿ªËٶȷdz£Âý£¬¶øÇÒ»ù±¾ÉÏÒ²Óò»µ½Õâ¸ö¿ÉÊÓ»¯µÄJSP±à¼­Æ÷£¬¶à°ë¶¼ÊÇʹÓÃMyEclipse JSP Editor£¬ËùÒÔ£¬ÓбØÒª°ÑĬÈϵÄJSPÎļþ±à¼­Æ÷¸Ä³ÉMyEclipse JSP Editor£¬·½±ãʹÓã¬Ò²¿É ......

JSPÖеÄpage,request,session,application

application£ºÈ«¾Ö×÷Ó÷¶Î§£¬Õû¸öÓ¦ÓóÌÐò¹²Ïí£¬¾ÍÊÇÔÚ²¿ÊðÎļþÖеÄͬһ¸öwebApp¹²Ïí£¬ÉúÃüÖÜÆÚΪ£ºÓ¦ÓóÌÐòÆô¶¯µ½Í£Ö¹¡£
session£º»á»°×÷ÓÃÓò£¬µ±Óû§Ê״ηÃÎÊʱ£¬²úÉúÒ»¸öеĻỰ£¬ÒÔºó·þÎñÆ÷¾Í¿ÉÒÔ¼ÇסÕâ¸ö»á»°×´Ì¬¡£ÉúÃüÖÜÆÚ£º»á»°³¬Ê±£¬»òÕß·þÎñÆ÷¶ËÇ¿ÖÆÊ¹»á»°Ê§Ð§¡£
sessionÊÇÕë¶Ôµ¥¸ö¿Í»§ºÍ·þÎñÆ÷½øÐлỰµÄ  ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØÍ¼ | ¸ÓICP±¸09004571ºÅ