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

JSPµÄ¾Å¸öÒþº¬¶ÔÏó

Ò»¡¢page ¶ÔÏó
    page¶ÔÏó´ú±íJSP±¾Éí£¬¸ü׼ȷµØ˵Ëü´ú±íJSP±»×ªÒëºóµÄServlet£¬Ëü¿ÉÒÔµ÷ÓÃServletÀàËù¶¨ÒåµÄ·½·¨¡£
    
¶þ¡¢config ¶ÔÏó
    config ¶ÔÏóÀï´æ·Å×ÅһЩServlet ³õʼµÄÊý¾Ý½á¹¹¡£
    config ¶ÔÏóʵÏÖÓÚjavax.servlet.ServletConfig ½Ó¿Ú£¬Ëü¹²ÓÐÏÂÁÐËÄÖÖ·½·¨£º
        public String getInitParameter(name)
        public java.util.Enumeration getInitParameterNames( )
        public ServletContext getServletContext( )
        public Sring getServletName( )
Èý¡¢request ¶ÔÏó
    request ¶ÔÏó°üº¬ËùÓÐÇëÇóµÄÐÅÏ¢£¬È磺ÇëÇóµÄÀ´Ô´¡¢±êÍ·¡¢cookiesºÍÇëÇóÏà¹ØµÄ²ÎÊýÖµµÈµÈ¡£
    request ¶ÔÏóʵÏÖjavax.servlet.http.HttpServletRequest½Ó¿ÚµÄ£¬ËùÌṩµÄ·½·¨¿ÉÒÔ½«Ëü·ÖΪËÄ´óÀࣺ
    1.´¢´æºÍÈ¡µÃÊôÐÔ·½·¨£»
        void setAttribute(String name, Object value)    É趨nameÊôÐÔµÄֵΪvalue
        Enumeration getAttributeNamesInScope(int scope)    È¡µÃËùÓÐscope ·¶Î§µÄÊôÐÔ
        Object getAttribute(String name)                È¡µÃname ÊôÐÔµÄÖµ
        void removeAttribute(String name)                ÒƳýname ÊôÐÔµÄÖµ
    2.È¡µÃÇëÇó²ÎÊýµÄ·½·¨
        String getParameter(String name)   &


Ïà¹ØÎĵµ£º

jspÒ³ÃæÏòflash´«µÝ²ÎÊý

ActioÖд«µÝ²ÎÊý
  request.setAttribute("userName",fbName);
  request.setAttribute("passWord",pwd);
  request.setAttribute("CDNUrl",CDNUrl);
-------------------------------------------------------------------
AC_FL_RunContent(
 'codebase', 'http://download.macromed ......

´¿JSP·ÖÒ³´úÂë

<%@ page contentType="text/html; charset=gb2312" %>
<%@ page language="java" %>
<%@ page import="java.sql.*" %>
<%
//Çý¶¯³ÌÐòÃû
String driverName="org.gjt.mm.mysql.Driver";
//Êý¾Ý¿âÓû§Ãû
String userName="root";
//ÃÜÂë
S ......

tomcat¡¢JDKºÍJSPÅäÖÃ

¾­³£¿´µ½Ðí¶àÈËÎÊÈçºÎÅäÖÃJDKºÍJSP£¬ÏÖÔÚÎÒ°Ñ·½·¨×ܽáÏ£¬Ï£Íû¶Ô´ó¼ÒÓÐËù°ïÖú¡£
µÚÒ»²½£ºÏÂÔØjdkºÍtomcat
µÚ¶þ²½£º°²×°ºÍÅäÖÃÄãµÄjdkºÍtomcat£ºÖ´ÐÐjdkºÍtomcatµÄ°²×°³ÌÐò£¬È»ºóÉèÖð´ÕÕ·¾¶½øÐа²×°¼´¿É¡£
1.°²×°j2sdkÒÔºó£¬ÐèÒªÅäÖÃһϻ·¾³±äÁ¿£¬ÔÚÎҵĵçÄÔ->ÊôÐÔ->¸ß¼¶->»·¾³±äÁ¿->ϵͳ±äÁ¿ÖÐÌí¼ÓÒÔÏ»· ......

jsp³£ÓÃÄÚÖöÔÏó

JSP ÄÚÖöÔÏó ÊÕ²Ø
ÄÚÖöÔÏóÊDz»ÐèÒªÉùÃ÷£¬Ö±½Ó¿ÉÒÔÔÚJSPÖÐʹÓõĶÔÏó£¬JSPÓÐÒÔϼ¸ÖÖÄÚÖöÔÏó£º
1.request¶ÔÏó
request±íʾHttpServletRequest¶ÔÏó¡£Ëü°üº¬ÁËÓйØä¯ÀÀÆ÷ÇëÇóµÄÐÅÏ¢£¬²¢ÇÒÌṩÁ˼¸¸öÓÃÓÚ»ñÈ¡cookie, header, ºÍsessionÊý¾ÝµÄÓÐÓõķ½·¨¡£¿Í»§¶ËµÄÇëÇóÐÅÏ¢±»·â×°ÔÚrequest¶ÔÏóÖУ¬Í¨¹ýËü²ÅÄÜÁ˽⵽¿Í»§ ......

¿ª·¢JSP³ÌÐò

»·¾³ÅäÖúú󣬿ª·¢JSP³ÌÐò¾Í·Ç³£¼òµ¥ÁË¡£
File-->New-->Web Project
Ôڸô°¿ÚÖÐÊäÈëһЩ¹¤³Ì»ù±¾ÐÅÏ¢£¬±ÈÈ繤³ÌÃû£¬ÕâÀïÊäÈëΪ  test1-01 
ÕâÑùÒ»¸ö»ùÓÚJSPµÄÏîÄ¿¾Í½¨Á¢ÆðÀ´ÁË¡£
 
Package  Explorer µÄÏÔʾ·½·¨£º
Windows-->Show View-->Package Explorer ÕâÑù¾ÍÄÜÏÔʾ³öÀ´À²£¡
Ï ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ