jsp 9¸öÄÚÖöÔÏóÏê½â jsp »ù´¡ÖªÊ¶
1.request¶ÔÏó
¿Í»§¶ËµÄÇëÇóÐÅÏ¢±»·â×°ÔÚrequest¶ÔÏóÖУ¬Í¨¹ýËü²ÅÄÜÁ˽⵽¿Í»§µÄÐèÇó£¬È»ºó×ö³öÏìÓ¦¡£ËüÊÇHttpServletRequestÀàµÄʵÀý¡£
ÐòºÅ ·½ ·¨ ˵ Ã÷
1 object getAttribute(String name) ·µ»ØÖ¸¶¨ÊôÐÔµÄÊôÐÔÖµ
2 Enumeration getAttributeNames() ·µ»ØËùÓпÉÓÃÊôÐÔÃûµÄö¾Ù
3 String getCharacterEncoding() ·µ»Ø×Ö·û±àÂ뷽ʽ
4 int getContentLength() ·µ»ØÇëÇóÌåµÄ³¤¶È£¨ÒÔ×Ö½ÚÊý£©
5 String getContentType() µÃµ½ÇëÇóÌåµÄMIMEÀàÐÍ
6 ServletInputStream getInputStream() µÃµ½ÇëÇóÌåÖÐÒ»ÐеĶþ½øÖÆÁ÷
7 String getParameter(String name) ·µ»ØnameÖ¸¶¨²ÎÊýµÄ²ÎÊýÖµ
8 Enumeration getParameterNames() ·µ»Ø¿ÉÓòÎÊýÃûµÄö¾Ù
9 String[] getParameterValues(String name) ·µ»Ø°üº¬²ÎÊýnameµÄËùÓÐÖµµÄÊý×é
10 String getProtocol() ·µ»ØÇëÇóÓõÄÐÒéÀàÐͼ°°æ±¾ºÅ
11 String getScheme() ·µ»ØÇëÇóÓõļƻ®Ãû,Èç:http.https¼°ftpµÈ
12 String getServerName() ·µ»Ø½ÓÊÜÇëÇóµÄ·þÎñÆ÷Ö÷»úÃû
13 int getServerPort() ·µ»Ø·þÎñÆ÷½ÓÊÜ´ËÇëÇóËùÓõĶ˿ںÅ
14 BufferedReader getReader() ·µ»Ø½âÂë¹ýÁ˵ÄÇëÇóÌå
15 String getRemoteAddr() ·µ»Ø·¢ËÍ´ËÇëÇóµÄ¿Í»§¶ËIPµØÖ·
16 String getRemoteHost() ·µ»Ø·¢ËÍ´ËÇëÇóµÄ¿Í»§¶ËÖ÷»úÃû
17 void setAttribute(String key,Object obj) ÉèÖÃÊôÐÔµÄÊôÐÔÖµ
18 String getRealPath(String path) ·µ»ØÒ»ÐéÄâ·¾¶µÄÕæʵ·¾¶
2.response¶ÔÏó
response¶ÔÏó°üº¬ÁËÏìÓ¦¿Í»§ÇëÇóµÄÓйØÐÅÏ¢£¬µ«ÔÚJSPÖкÜÉÙÖ±½ÓÓõ½Ëü¡£ËüÊÇHttpServletResponseÀàµÄʵÀý¡£
ÐòºÅ ·½ ·¨ ˵ Ã÷
1 String getCharacterEncoding() ·µ»ØÏìÓ¦ÓõÄÊǺÎÖÖ×Ö·û±àÂë
2 ServletOutputStream getOutputStream() ·µ»ØÏìÓ¦µÄÒ»¸ö¶þ½øÖÆÊä³öÁ÷
3 PrintWriter getWriter() ·µ»Ø¿ÉÒÔÏò¿Í»§¶ËÊä³ö×Ö·ûµÄÒ»¸ö¶ÔÏó
4 void setContentLength(int len) ÉèÖÃÏìӦͷ³¤¶È
5 void setContentType(String type) ÉèÖÃÏìÓ¦µÄMIMEÀàÐÍ
6 sendRedirect(java.lang.String location) ÖØж¨Ïò¿Í»§¶ËµÄÇëÇó
¡¡
3.session¶ÔÏó
session¶ÔÏóÖ¸µÄÊÇ¿Í»§¶ËÓë·þÎñÆ÷µÄÒ»´Î»á»°£¬´Ó¿Í»§Á¬µ½·þÎñÆ÷µÄÒ»¸öWebApplication¿ªÊ¼£¬Ö±µ½¿Í»§¶ËÓë·þÎñÆ÷¶Ï¿ªÁ¬½ÓΪֹ¡£ËüÊÇHttpSessionÀàµÄʵÀý.
ÐòºÅ ·½ ·¨ ˵ Ã÷
1 long getCreationTime() ·µ»ØSESSION´´½¨Ê±¼ä
2 public String getId() ·µ»ØSESSION´´½¨Ê±JSPÒýÇæΪËü
Ïà¹ØÎĵµ£º
Ò»¡¢°²×°JDK ¡¡¡¡Ê×ÏÈÏÂÔØJDK 5.0£¨JDK 5.0µÄÏÂÔØÒ³ÃæΪ£ºhttp://java.sun.com/j2se/1.5.0/download.jsp£©£» È»ºóÔËÐÐJDK 5.0°²×°³ÌÐòjdk-1_5_0_06-windows-i586-p.exe£¬°²×°¹ý³ÌÖÐËùÓÐÑ¡Ïî±£³ÖĬÈÏ£»×îºóÅäÖÃJDKµÄ»·¾³±äÁ¿£ºÔÚ“ÎҵĵçÄÔ”ÉϵãÓÒ¼ü—>“ÊôÐÔ”—>“¸ß¼¶”& ......
try {
URL url = new URL("http://www.163.com");
InputStream is = url.openStream();
byte[] buffer = new byte[1024];
  ......
<%@ page language="java" import="kg.TestBean2;" %>
<%@ page contentType="text/html;charset=gb2312" %>
<html>
<head>
<title>HelloBean</title>
</head>
<body>
<%--
<%
kg.TestBean2 testbean=(kg.TestBean2)session.setAttribute("testbean");
if ......
Ò»¡¢
ÎÊ£ºorg.postgresql.util.PSQLException: FATAL: no pg_hba.conf entry for host "192.168.254.103", user "postgres",database "postgres", SSL off
´ð£ºPostgreSQÊý¾Ý¿âΪÁË°²È«£¬Ëü²»»á¼àÌý³ý±¾µØÒÔÍâµÄËùÓÐÁ¬½ÓÇëÇ󣬵±Óû§Í¨¹ýJDBC·ÃÎÊÊÇ£¬¾Í»á±¨Ò»Ð©ÒÔÉϵÄÒì³£¡£Òª½â¾öÕâ¸öÎÊÌâ ......
ÍøÒ³»º´æµÄ×÷ÓÃÊÇʲô£¿Ó¦¸ÃºÜÖØÒª¡£µ«ÊÇÎÒÃÇÔÚ¿ª·¢ÍøÂçÓ¦ÓõÄʱºò£¬ÍøÒ³»º´æ×ÜÊǸøÎÒÃÇÒ»ÖÖĪÃûµÄ·³ÄÕ¡£ÓÚÊǼ¸ºõÿһ¸ö¿ª·¢Õ߶¼ÊÔͼ½â¾ö¹ýÕâ¸öÎÊÌâ¡£µ±È»£¬ÎÒÒ²²»ÊǽñÌì²Å×ÅÊÖ½â¾öÕâ¸öÎÊÌâ¡£µ«ÊǽñÌìһʱÐÄѪÀ´³±£¬Ð´Ò»Æª£¬¼Ç¼һÏÂÓõ½µÄ·½·¨¡£
1.½ûÖ¹¿Í»§¶Ë»º´æÒªÔÚ<head>ÖмÓÈëÀàËÆÈçÏÂÄÚÈÝ(ÎÒµ±È»»¹Ã»Ó ......