??xml version="1.0" encoding="utf-8" standalone="yes"?>国产一区二三区好的,日韩大陆欧美高清视频区,欧美黄色小说http://www.aygfsteel.com/doodoosun/category/25586.html万物皆备于我zh-cnMon, 12 May 2008 13:17:43 GMTMon, 12 May 2008 13:17:43 GMT60断言 和Junit 试http://www.aygfsteel.com/doodoosun/archive/2008/05/12/200040.htmldoodoosundoodoosunMon, 12 May 2008 08:14:00 GMThttp://www.aygfsteel.com/doodoosun/archive/2008/05/12/200040.htmlhttp://www.aygfsteel.com/doodoosun/comments/200040.htmlhttp://www.aygfsteel.com/doodoosun/archive/2008/05/12/200040.html#Feedback0http://www.aygfsteel.com/doodoosun/comments/commentRss/200040.htmlhttp://www.aygfsteel.com/doodoosun/services/trackbacks/200040.html The assertion mechanism allows you to put in checks during testing and to have them automatically removed in the production code.
?在写代码时进行测试检查,在发布程序的时候屏蔽测试检?br />



doodoosun 2008-05-12 16:14 发表评论
]]>
JDK 5 中新Ҏ?可变参数列表http://www.aygfsteel.com/doodoosun/archive/2008/05/09/199528.htmldoodoosundoodoosunFri, 09 May 2008 08:08:00 GMThttp://www.aygfsteel.com/doodoosun/archive/2008/05/09/199528.htmlhttp://www.aygfsteel.com/doodoosun/comments/199528.htmlhttp://www.aygfsteel.com/doodoosun/archive/2008/05/09/199528.html#Feedback1http://www.aygfsteel.com/doodoosun/comments/commentRss/199528.htmlhttp://www.aygfsteel.com/doodoosun/services/trackbacks/199528.htmlJDK 1.5 提供了可变量参数Q每个方法只能提供一个类型作为可变参敎ͼ同时它必?br /> 在参数列表的最?br />
适用条g:传入到方法的参数的个数是不固定的Qؓ了解册个问题,通常了两U方?br />
1.重蝲?
Log.log(String code)
Log.log(String code,String arg)
Log.log(String code,String arg1,String arg2)
2.把参CZ个数l传入,声明数组把参C个一个的加到数组中去
Log.log(String code,String[] args)



自从有了可变参数列表Q革命的面貌焕然一斎ͼ可变参数列表可以辑ֈ以一敌三或者以一敌百的效?br /> ?

用了可变参数Q用下面Ҏ可以替换前面四个Ҏ
Log.log(String code,String... args)

声明可变长参数方式如?/span>:

public void mymethod(String arg1,Object… args)

也就是?/span>…参数声明成可变长参数?/span>

昄Q可变长参数必须是最后一个参数?/font>

L下面唐僧师傅l悟I佛经的例子:


 

package test;
public class Varargs1
{
    
public void speak(String name,Object arguments)
    
{
        
for(Object object : arguments)
        
{
            System.out.println(object);package test;
public class Varargs1
{
public void speak(String name,Object arguments)
{
for(Object object : arguments)
{
System.out.println(object);
}
}

public static void main(String[] args)
{
Varargs1 va = new Varargs1();
va.speak("悟空","人和妖精都是妈生?");
va.speak("悟空","不同的h是h他妈生的,","妖是妖他妈生?");
}
}
        }

    }


    
public static void main(String[] args)
    
{
        Varargs1 va 
= new Varargs1();
        va.speak(
"悟空","人和妖精都是妈生?");
        va.speak(
"悟空","不同的h是h他妈生的,","妖是妖他妈生?");
    }

}



public class Demo {

    
private static int add(int  values)
    
{
        
int sum=0;
        
for(int n:values) // foreach也是JDK1.5新添加的遍历成员的@环机?/span>
            sum+=n;
        
return sum;
        
    }

    
/**
    * 
@param args
    
*/

    
public static void main(String[] args) {
        
// TODO Auto-generated method stub
        System.out.println(add(1,2,3,4,5)); //参数个数可变
    System.out.println(add(1,2));
    }

}


 



doodoosun 2008-05-09 16:08 发表评论
]]>
java 代码学习|站http://www.aygfsteel.com/doodoosun/archive/2007/05/28/120410.htmldoodoosundoodoosunMon, 28 May 2007 02:30:00 GMThttp://www.aygfsteel.com/doodoosun/archive/2007/05/28/120410.htmlhttp://www.aygfsteel.com/doodoosun/comments/120410.htmlhttp://www.aygfsteel.com/doodoosun/archive/2007/05/28/120410.html#Feedback0http://www.aygfsteel.com/doodoosun/comments/commentRss/120410.htmlhttp://www.aygfsteel.com/doodoosun/services/trackbacks/120410.htmlhttp://www.java2s.com/
   q个|站非常好,分成三大c,分别?font color=#800080 size=2>Example?font size=2>Products?/font> ArticlesQ每个大cM又分别设许多类Q还有搜索功能,q样查找h非常方便。。比如,如果要学习SWT/JFaceQ只要把Example下的SWT JFace Eclipse 研究一下也可以了。另外,q个|站q有JavaScript DHTML?C# / C Sharp?C / ANSI-C?SQL / MySQL{类。MQ非常好?br>
  2. codeZoo http://www.codezoo.com/
   q是O'Reily旗下的,除了Java之外Q还有Ruby、Python?/div>
 
  3. Java学习源代码检索系l?nbsp; http://www.chinaitlab.com/www/school/codesearch/index.html
   隑־看见国的,好歹也要支持一下,分类也算清楚?/div>
 
  4. Koders  http://www.koders.com/
   是个l合查询的网站,不过它好像是从代码中查找关键词,包含的语a挺多的?/div>
 
  5. Resources for Java server-side developers  http://www.java201.com/
   切的说Q它是一个资源收集的|站Q代码查询ƈ不多。不q它分类相当l,如Articles、Books、Examples、Extensions、Frameworks{类Q你可以输入Spring或Hibernate作ؓ关键词搜索一下看看?/div>

doodoosun 2007-05-28 10:30 发表评论
]]>JSP内徏对象http://www.aygfsteel.com/doodoosun/archive/2007/04/19/111969.htmldoodoosundoodoosunThu, 19 Apr 2007 08:04:00 GMThttp://www.aygfsteel.com/doodoosun/archive/2007/04/19/111969.htmlhttp://www.aygfsteel.com/doodoosun/comments/111969.htmlhttp://www.aygfsteel.com/doodoosun/archive/2007/04/19/111969.html#Feedback0http://www.aygfsteel.com/doodoosun/comments/commentRss/111969.htmlhttp://www.aygfsteel.com/doodoosun/services/trackbacks/111969.html?out - javax.servlet.jsp.jspWriter
   out对象用于把结果输出到|页上?/font>

ҎQ?br>1. void clear() ;
   清除输出~冲区的内容Q但是不输出到客L?/font>

2. void clearBuffer() ;
   清除输出~冲区的内容Qƈ输出到客L?/font>

3. void close() ;
   关闭输出,清除所有内宏V?/font>

4. void flush() ;
   输出~冲区里面的数据?/font>

5. int getBufferSize() ;
   获取以kb为单位的目前~冲区大?/font>

6. int getRemaining() ;
   获取以kb为单位的~冲Z未被占用的空间大?/font>

7. boolean isAutoFlush() ;
   是否自动h~冲区?/font>

8. void newLine() ;
   输出一个换行字W?/font>

9. void print( boolean b ) ;
   void print( char c ) ;
   void print( char[] s ) ;
   void print( double d ) ;
   void print( float f ) ;
   void print( int i ) ;
   void print( long l ) ;
   void print( Object obj ) ;
   void print( String s ) ;
   指定类型的数据输出到Http,不换行?/font>

10. void println( boolean b ) ;
    void println( char c ) ;
    void println( char[] s ) ;
    void println( double d ) ;
    void println( float f ) ;
    void println( int i ) ;
    void println( long l ) ;
    void println( Object obj ) ;
    void println( String s ) ;
    指定类型的数据输出到Http,q输Z个换行符?br>   
11. Appendable append( char c ) ;
    Appendable append( CharSequence cxq, int start, int end ) ;
    Appendable append( CharSequence cxq ) ;
    一个字W或者实CCharSequence接口的对象添加到输出的后面?/font>

成员Q?br>int DEFAULT_BUFFER = 0    - ~省~冲区大?br>int NO_BUFFER = -1        - writer是否处于~冲输出状?br>int UNBOUNDED_BUFFER = -2 - 是否限制~冲区大?/font>


?request - javax.servlet.http.HttpServletRequest
   request对象包含所有请求的信息Q如h的来源、标头、cookies和请求相关的参数值等?/font>

ҎQ?br>1. Object getAttribute( String name ) ;
   q回由name指定的属性|该属性不存在时返回null?/font>

2. Enumeration getAttributeNames() ;
   q回request对象的所有属性名U的集合?/font>

3. String getAuthType() ;
   q回用来保护servlet的认证方法的名称Q未受保护时q回null?/font>

4. String getCharacterEncoding() ;
   q回h中的字符~码ҎQ可以在response对象中设|?/font>

5. int getContentLength() ;
   q回h的BODY的长度,不能定长度时返?1。可以在response中设|?/font>

6. String getContentType() ;
   q回在response中定义的内容cd?/font>

7. String getContentPath() ;
   q回h的\径?/font>

8. Cookie[] getCookies() ;
   q回客户端所有的Cookie的数l?/font>

9. Enumeration getHeaderNames() ;
   q回所有HTTP头的名称的集合?/font>

10. Enumeration getHeaders( String name ) ;
    q回指定HTTP头的所有值的集合?/font>

11. String getHeader( String name ) ;
    q回指定名称的HTTP头的信息?/font>

12. long getDateHeader( String name ) ;
    q回指定名称的Datacd的HTTP头的信息?/font>

13. int getIntHeader( String name ) ;
    q回指定名称的Intcd的HTTP头的信息?/font>

14. ServletInputStream getInputStream() ;
    q回h的输入流?/font>

15. Locale getLocale() ;
    q回当前늚Locale对象Q可以在response中设定?/font>

16. Enumeration getLocales() ;
    q回h中所有的Locale对象的集合?/font>

17. String getLocalName() ;
    获取响应h的服务器端主机名?/font>

18. String getLocalAddr() ;
    获取响应h的服务器端地址?/font>

19. int getLocalPort() ;
    获取响应h的服务器端端?/font>

20. String getMethod() ;
    获取客户端向服务器端发送请求的Ҏ(GET、POST)?/font>

21. String getParameter( String name ) ;
    获取客户端发送给服务器端的参数倹{?/font>

22. Map getParameterMap() ;
    该方法返回包含请求中所有参数的一个Map对象?/font>

23. Enumeration getParameterNames() ;
    q回h中所有参数的集合?/font>

24. String[] getParameterValues( String name ) ;
    获得h中指定参数的所有倹{?/font>

25. String getQueryString() ;
    q回getҎ传递的参数字符Ԍ该方法不分解出单独的参数?/font>

26. String getPathInfo() ;
    取出h中处于ServletPath和QueryString之间的额外信息?/font>

27. String getPathTranslated() ;
    q回用getPathInfo()Ҏ取得的\径信息的实际路径?/font>

28. String getProtocol() ;
    q回h使用的协议。可以是HTTP1.1或者HTTP1.0?/font>

29. BufferedReader getReader() ;
    q回h的输入流对应的Reader对象Q该Ҏ和getInputStream()Ҏ在一个页面中只能调用一个?/font>

30. String getRemoteAddr() ;
    获取发出h的客LIP地址?/font>

31. String getRemoteHost() ;
    获取发出h的客LL?/font>

32. String getRemoteUser() ;
    q回l过客户端验证的用户名,未经验证q回null?/font>

33. int getRemotePort() ;
    q回发出h的客LL端口?/font>

34. String getRealPath( String path ) ;
    q回l定虚拟路径的物理\径?/font>

35. RequestDispatcher getRequestDispatcher( String path ) ;
    按给定的路径生成资源转向处理适配器对象?/font>

36. String getRequestedSessionId() ;
    q回h的session的标识?/font>

37. String RequestURI() ;
    q回发出h的客L地址Q但是不包括h的参数字W串?/font>

38. StringBuffer getRequestURI() ;
    q回响应h的服务器端地址

39. String getScheme() ;
    获取协议名称Q缺省gؓHTTP协议?/font>

40. String getServerName() ;
    q回响应h的服务器名称?/font>

41. String getServletPath() ;
    获取客户端所h的脚本文件的文g路径?/font>

42. int getServerPort() ;
    获取响应h的服务器端主机端口号?/font>

43. void removeAttribute( String name ) ;
    在属性列表中删除指定名称的属性?/font>

44. void setAttribute( String name, Object value ) ;
    在属性列表中d/删除指定的属性?/font>

45. void setCharacterEncoding( String name ) ;
    讄h的字W编码格式?/font>

46. HttpSession getSession() ;
    HttpSession getSession( boolean create ) ;
    获取sessionQ如果create为trueQ在无session的情况下创徏一个?br>   
47. boolean isRequestedSessionIdFromCookie() ;
    查请求的会话ID是否为通过Cookie传入?/font>

48. boolean isRequestedSessionIdFromURL() ;
    查请求的会话ID是否为通过URL传入?/font>

49. boolean isRequestedSessionIdValid() ;
    查请求的会话ID是否仍然有效?/font>

50. boolean isSecure() ;
    查请求是否用安全链接,如果HTTPS{?/font>

51. boolean isUserInRole( String role ) ;
    查已l通过验证的用h否在是role所指定的角艌Ӏ?/font>

52. Principal getUserPrincipal() ;
    q回包含用户登陆名的一个java.security.Principal对象?/font>

成员Q?br>String BASIC_AUTH = "BASIC"             -
String CLIENT_CERT_AUTH = "CLIENT_CERT" -
String DIGEST_AUTH = "DIGEST"           -
String FORM_AUTH = "FORM"               -


?response - javax.servlet.http.HttpServletResponse
   response对象主要JSP容器处理后的l果传回到客L?/font>

ҎQ?br>1. void addCookie( Cookie cookie ) ;
   d一个Cookie对象Q保存客L信息?/font>

2. void addDateHeader( String name, long value ) ;
   d一个日期类型的HTTP头信息,覆盖同名的HTTP头信息?/font>

3. void addHeader( String name, String value ) ;
   d一个HTTP_覆盖同名的旧HTTP头?/font>

4. void addIntHeader( String name, int value ) ;
   d一个整型的HTTP_覆盖同名的旧HTTP头?/font>

5. boolean containsHeader( String name ) ;
   判断指定的HTTP头是否存在?/font>

6. String encodeRedirectURL( String url ) ;
   对sendRedirect()Ҏ使用的URLq行~码?/font>

7. String encodeURL( String url ) ;
   URL予以~码Q回传包含session ID的URL?br>  
8. void flushBuffer() ;
   强制把当前缓冲区的内容发送到客户端?/font>

9. int getBufferSize() ;
   取得以kb为单位的~冲区大?/font>

10. String getCharacterEncoding() ;
    获取响应的字W编码格式?/font>

11. String getContentType() ;
    获取响应的类型?/font>

12. Locale getLocale() ;
    获取响应的Locale对象?/font>

13. ServletOutputStream getOutputStream() ;
    q回客户端的输出对象?/font>

14. PrintWriter getWriter() ;
    获取输出对应的writer对象?/font>

15. boolean isCommitted() ;
    判断服务器端是否已经数据输出到客户端?/font>

16. void reset() ;
    清空buffer中的所有内宏V?/font>

17. void resetBuffer() ;
    情况buffer中所有的内容Q但是保留HTTP头和状态信息?/font>

18. void sendError( int xc, String msg ) ;
    void sendError( int xc ) ;
    发送错误,包括状态码和错误信息?/font>

19. void sendRedirect( String locationg ) ;
    把响应发送到另外一个位|进行处理?/font>

20. void setBufferSize( int size ) ;
    讄以kb为单位的~冲区大?/font>

21. void setCharacterEncoding( String charset ) ;
    讄响应使用的字W编码格式?/font>

22. void setContentLength( int length ) ;
    讄响应的BODY长度?/font>

23. void setContentType( String type ) ;
    讄响应的类型?/font>

24. void setDateHeader( String name, long value ) ;
    讄指定名称的Datacd的HTTP头的倹{?/font>

25. void setHeader( String name, String value ) ;
    讄指定名称的HTTP头的倹{?/font>

26. void setIntHeader( String name, int value ) ;
    讄指定名称的intcd的HTTP头的倹{?/font>

27. void setStatus( int xc ) ;
    讄响应状态码Q新g覆盖当前倹{?/font>

成员(HTTP状态码)Q?br>int SC_CONTINUE = 100                      int SC_SWITCHING_PROTOCOLS = 101
int SC_OK = 200                            int SC_NON_AUTHORITATIVE_INFORMATION = 203
int SC_ACCEPTED = 202                      int SC_CREATED = 201
int SC_NO_CONTENT = 204                    int SC_RESET_CONTENT = 205
int SC_PARTIAL_CONTENT = 206               int SC_MULTIPLE_CHOICES = 300
int SC_MOVED_PERMANENTLY = 301             int SC_MOVED_TEMPORARILY = 302
int SC_FOUND = 302                         int SC_SEE_OTHER = 303
int SC_NOT_MODIFIED = 304                  int SC_USE_PROXY = 305
int SC_TEMPORARY_REDIRECT = 307            int SC_BAD_REQUEST = 400
int SC_UNAUTHORIZED = 401                  int SC_PAYMENT_REQUIRED = 402
int SC_FORBIDDEN = 403                     int SC_NOT_FOUND = 404
int SC_METHOD_NOT_ALLOWED = 405            int SC_NOT_ACCEPTABLE = 406
int SC_PROXY_AUTHENTICATION_REQUIRED = 407 int SC_REQUEST_TIMEOUT = 408
int SC_CONFLICT = 409                      int SC_GONE = 410
int SC_LENGTH_REQUIRED = 411               int SC_PRECONDITION_FAILED = 412
int SC_REQUEST_ENTITY_TOO_LARGE = 413      int SC_REQUEST_URI_TOO_LONG = 414
int SC_UNSUPPORTED_MEDIA_TYPE = 415        int SC_REQUESTED_RANGE_NOT_SATISFIABLE = 416
int SC_EXPECTATION_FAILED = 417            int SC_INTERNAL_SERVER_ERROR = 500
int SC_NOT_IMPLEMENTED = 501               int SC_BAD_GATEWAY = 502
int SC_SERVICE_UNAVAILABLE = 503           int SC_GATEWAY_TIMEOUT = 504
int SC_HTTP_VERSION_NOT_SUPPORTED = 505


?session - javax.servlet.http.HttpSession
   session对象表示目前个别用户的会话状态,用来识别每个用户?/font>

ҎQ?br>1. Object getAttribute( String name ) ;
   获取与指定名字相兌的session属性倹{?/font>

2. Enumeration getAttributeNames() ;
   取得session内所有属性的集合?/font>

3. long getCreationTime() ;
   q回session的创建时_最单位千分之一U?/font>

4. String getId() ;
   取得session标识?/font>

5. long getLastAccessedTime() ;
   q回与当前session相关的客L最后一ơ访问的旉Q由1970-01-01vQ单位毫U?/font>

6. int getMaxInactiveInterval( int interval ) ;
   q回L_以秒为单位,表示session的有效时?session不活动时??1为永不过期?/font>

7. ServletContext getServletContext() ;
   q回一个该JSP面对应的ServletContext对象实例?/font>

8. HttpSessionContext getSessionContext() ;
  

9. Object getValue( String name ) ;
   取得指定名称的session变量|不推荐用?/font>

10. String[] getValueNames() ;
    取得所有session变量的名U的集合Q不推荐使用?/font>

11. void invalidate() ;
    销毁这个session对象?/font>

12. boolean isNew() ;
    判断一个session是否由服务器产生Q但是客Lq没有用?/font>

13. void pubValue( String name, Object value ) ;
    d一个session变量Q不推荐使用?/font>

14. void removeValue( String name ) ;
    U除一个session变量的|不推荐用?/font>

15. void setAttribute( String name, String value ) ;
    讄指定名称的session属性倹{?/font>

16. void setMaxInactiveInterval( int interval ) ;
    讄session的有效期?/font>

17. void removeAttribute( String name ) ;
    U除指定名称的session属性?/font>


?pageContext - javax.servlet.jsp.PageContext
   pageContext对象存储本JSP面相关信息Q如属性、内建对象等?/font>

ҎQ?br>1. void setAttribute( String name, Object value, int scope ) ;
   void setAttribute( String name, Object value ) ;
   在指定的׃n范围内设|属性?/font>

2. Object getAttribute( String name, int scope ) ;
   Object getAttribute( String name ) ;
   取得指定׃n范围内以name为名字的属性倹{?/font>

3. Object findAttribute( String name ) ;
   按页面、请求、会话和应用E序׃n范围搜烦已命名的属性?/font>

4. void removeAttribute( String name, int scope ) ;
   void removeAttribute( String name ) ;
   U除指定名称和共享范围的属性?/font>

5. void forward( String url ) ;
   页面导航到指定的URL?/font>

6. Enumeration getAttributeNamesScope( int scope ) ;
   取得指定׃n范围内的所有属性名U的集合?/font>

7. int getAttributeScope( String name ) ;
   取得指定属性的׃n范围?/font>

8. ErrorData getErrorDate() ;
   取得面的errorData对象?/font>

9. Exception getException() ;
   取得面的exception对象?/font>

10. ExpressionEvaluator getExpressionEvaluator() ;
    取得面的expressionEvaluator对象?/font>

11. JspWriter getOut() ;
    取得面的out对象?/font>

12. Object getPage() ;
    取得面的page对象?/font>

13. ServletRequest getRequest() ;
    取得面的request对象?/font>

14. ServletResponse getResponse() ;
    取得面的response对象?/font>

15. ServletConfig getConfig() ;
    取得面的config对象?/font>

16. ServletContext getServletContext() ;
    取得面的servletContext对象?/font>

17. HttpSession getSession() ;
    取得面的session对象?/font>

18. VariableResolver getVariableResolver() ;
    取得面的variableResolver对象?/font>

19. void include( String url, boolean flush ) ;
    void include( String url ) ;
    包含其他的资源,q指定是否自动刷新?/font>

20. void release() ;
    重置pageContext内部状态,释放所有内部引用?/font>

21. void initialize( Servlet servlet, ServletRequest request, ServletResponse response,
                     String errorPageURL, boolean needSession, int bufferSize, boolean autoFlush ) ;
    初始化未l初始化的pageContext对象?/font>

22. BodyContext pushBody() ;
    BodyContext pushBody( Writer writer ) ;
    保存当前的out对象Qƈ更新pageContext中page范围内的out对象?/font>

23. JspWrite popBody() ;
    取出由pushBody()Ҏ保存的out对象?/font>

24. void handlePageException( Exception e ) ;
    void handlePageException( Thrwoable t ) ;
   

成员Q?br>int PAGE_SCOPE = 1        - 面׃n范围
int REQUEST_SCOPE = 2     - h׃n范围
int SESSION_SCOPE = 3     - 会话׃n范围
int APPLICATION_SCOPE = 4 - 应用E序׃n范围
String PAGE = "javax.servlet.jsp.jspPage"
String PAGECONTEXT = "javax.servlet.jsp.jspPageContext"
String REQUEST = "javax.servlet.jsp.jspRequest"
String RESPONSE = "javax.servlet.jsp.jspResponse"
String CONFIG = "javax.servlet.jsp.jspConfig"
String SESSION = "javax.servlet.jsp.jspSession"
String OUT = "javax.servlet.jsp.jspOut"
String APPLICATION = "javax.servlet.jsp.jspApplication"
String EXCEPTION = "javax.servlet.jsp.jspException"


?application - javax.servlet.ServletContext
   application主要功用在于取得或更改Servlet的设定?/font>

ҎQ?br>1. Object getAttribute( String name ) ;
   q回由name指定的application属性?/font>

2. Enumeration getAttributes() ;
   q回所有的application属性?/font>

3. ServletContext getContext( String uripath ) ;
   取得当前应用的ServletContext对象?/font>

4. String getInitParameter( String name ) ;
   q回由name指定的application属性的初始倹{?/font>

5. Enumeration getInitParameters() ;
   q回所有的application属性的初始值的集合?/font>

6. int getMajorVersion() ;
   q回servlet容器支持的Servlet API的版本号?/font>

7. String getMimeType( String file ) ;
   q回指定文g的类型,未知cdq回null。一般ؓ"text/html"?image/gif"?/font>

8. int getMinorVersion() ;
   q回servlet容器支持的Servlet API的副版本受?/font>

9. String getRealPath( String path ) ;
   q回l定虚拟路径所对应物理路径?/font>

10. RequestDispatcher getNamedDispatcher( String name ) ;
    为指定名字的Servlet对象q回一个RequestDispatcher对象的实例?/font>

11. RequestDispatcher getRequestDispatcher( String path ) ;
    q回一个RequestDispatcher对象的实例?/font>

12. URL getResource( String path ) ;
    q回指定的资源\径对应的一个URL对象实例Q参数要?/"开头?/font>

13. InputStream getResourceAsStream( String path ) ;
    q回一个由path指定位置的资源的InputStream对象实例?/font>

14. Set getResourcePaths( String path ) ;
    q回存储在web-app中所有资源\径的集合?/font>

15. String getServerInfo() ;
    取得应用服务器版本信息?/font>

16. Servlet getServlet( String name ) ;
    在ServletContext中检索指定名U的servlet?/font>

17. Enumeration getServlets() ;
    q回ServletContext中所有servlet的集合?/font>

18. String getServletContextName() ;
    q回本web应用的名U?/font>

19. Enumeration getServletContextNames() ;
    q回ServletContext中所有servlet的名U集合?/font>

20. void log( Exception ex, String msg ) ;
    void log( String msg, Throwable t ) ;
    void log( String msg ) ;
    把指定的信息写入servlet log文g?/font>

21. void removeAttribute( String name ) ;
    U除指定名称的application属性?/font>

22. void setAttribute( String name, Object value ) ;
    讑֮指定的application属性的倹{?/font>


?config - javax.servlet.ServletConfig
   config对象用来存放Servlet初始的数据结构?/font>

ҎQ?br>1. String getInitParameter( String name ) ;
   q回名称为name的促使参数的倹{?/font>

2. Enumeration getInitParameters() ;
   q回q个JSP所有的促参数的名U集合?/font>

3. ServletContext getContext() ;
   q回执行者的servlet上下文?/font>

4. String getServletName() ;
   q回servlet的名U?/font>


?exception - java.lang.Throwable
   错误对象Q只有在JSP面的page指o中指定isErrorPage="true"后,才可以在本页面用exception对象?/font>

ҎQ?br>1. Throwable fillInStackTrace() ;
   当前stack信息记录到exception对象中?/font>

2. String getLocalizedMessage() ;
   取得本地语系的错误提CZ息?/font>

3. String getMessage()
   取得错误提示信息?/font>

4. StackTrackElement[] getStackTrace() ;
   q回对象中记录的call stack track信息?/font>

5. Throwable initCause( Throwable cause ) ;
   另外一个异常对象嵌套进当前异常对象中?br>  
6. Throwable getCause() ;
   取出嵌套在当前异常对象中的异常?/font>

7. void printStackTrace() ;
   void printStackTrace( printStream s ) ;
   void printStackTrace( printWriter s ) ;
   打印出Throwable及其call stack trace信息?/font>

8. void setStackTrace( StackTraceElement[] stackTrace )
   讄对象的call stack trace信息?/font>


?page - javax.servlet.jsp.HttpJspPage
   page对象代表JSP对象本nQ或者说代表~译后的servlet对象Q?br>   可以? (javax.servlet.jsp.HttpJspPage)page )来取用它的方法和属性?/font>



doodoosun 2007-04-19 16:04 发表评论
]]>
վ֩ģ壺 Ϲ| | | | ̫| ˷| | | | | | | ƽ| | | ˮ| | | ƽ| ţ| | | | | | ˹| | ʤ| | ͨ| | | | ֶ| | | گ| ʯ¥| ʯ| | |