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

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ÒýÇæÎªËüÉèµÄΩһ


Ïà¹ØÎĵµ£º

jsp¾²Ì¬»¯ºÍα¾²Ì¬»¯

Ê×ÏÈ˵˵ΪʲôҪ¾²Ì¬»¯¡£
¶ÔÓÚÏÖÔÚµÄWeb ApplicationÀ´Ëµ£¬¶¯Ì¬Ò³ÃæÊÇÕ¼Óоø¶Ô¸ßµÄµØÎ»µÄ£¬ÕýÒòΪÓÐÁ˶¯Ì¬»¯£¬²ÅÓÐÁËÏÖÔÚWebµÄ·á¸»¶à²Ê£¬µ«ÊÇÈçͬËùÓбðµÄÊÂʵһÑù£¬ºÃ´¦ÍùÍù¶¼ÊÇÓдú¼ÛµÄ¡£
ΪÁ˲úÉú³ö¶¯Ì¬µÄЧ¹û£¬Ã¿Ò»´Î¶ÔÒ³ÃæµÄÇëÇó¶¼»áÒªÇó·þÎñÆ÷¶ÔÒ³Ãæ½øÐбàÒë»òÕßÖ´ÐУ¬ÕâЩ²Ù×÷¶¼ºÜÏûºÄϵͳ×ÊÔ´¡£Èç¹ûÕâÆÚ¼ä»¹ÓÐºÍ ......

JSP ÉÏ´«ºÍÏÂÔØÎļþ

×¼±¸Ìõ¼þ£º
ÔÚJboss4.2.2GA¸ùĿ¼Ï²¿ÊðÅäÖÃÎļþ£ºconstants.xml
<?xml version="1.0" encoding="UTF-8"?>
<constants>
<init-constants>
<context-param>
<name>path.upload.dcm</name>
<value>//192.168.1.37/upload/oaw/</value>
</context-para ......

JSPºÍSERVLETµ½µ×ÔÚÓ¦ÓÃÉÏÓÐÊ²Ã´Çø±ð

JSPºÍSERVLETµ½µ×ÔÚÓ¦ÓÃÉÏÓÐÊ²Ã´Çø±ð£¬ºÜ¶àÈ˸㲻Çå³þ¡£ÎÒÀ´ºú³¶¼¸¾ä°É¡£¼òµ¥µÄ˵£¬SUNÊ×ÏÈ·¢Õ¹³öSERVLET£¬Æä¹¦ÄܱȽÏÇ¿¾¢£¬ÌåϵÉè¼ÆÒ²ºÜÏȽø£¬Ö»ÊÇ£¬ËüÊä³öHTMLÓï¾ä»¹ÊDzÉÓÃÁËÀϵÄCGI·½Ê½£¬ÊÇÒ»¾äÒ»¾äÊä³ö£¬ËùÒÔ£¬±àдºÍÐÞ¸ÄHTML·Ç³£²»·½±ã¡£
ºóÀ´SUNÍÆ³öÁËÀàËÆÓÚASPµÄÏâǶÐ͵ÄJSP£¬°ÑJSP TAGÏâǶµ½HTMLÓï¾äÖУ¬ÕâÑù£¬¾Í ......

JSÓëJSPµÄÇø±ð(×ªÔØ)


ÔÚ¸÷ÖÖÍøÒ³ÖÆ×÷¼¼ÊõÂÛ̳ÖУ¬³£³£ÓÐÈËѯÎÊjavascriptÓëJavaÓÐÊ²Ã´Çø±ð£¬ÉõÖÁÓÐÈËÎóÈÏΪjavascript¾ÍÊÇJava¡£javascriptÓëJavaȷʵÓÐÒ»¶¨µÄÁªÏµ£¬µ«ËüÃDz¢²»ÏñÎÒÃÇÏëÏóµÄÄÇÑùÁªÏµ½ôÃÜ£¬ÉõÖÁ¿ÉÒԿ϶¨µØËµËüÃÇÓкܴóµÄÇø±ð¡£ 
¡¡¡¡Ê²Ã´ÊÇJavaScript £¿ 
¡¡¡¡JavaScript ÊǶԠECMA 262 Ó ......

JSP/servlet¿ª·¢µãµÎ

1.²¿ÊðÈýÖÖ·½Ê½£º
   (1) ÔÚserver.xmlµÄHost±êÇ©ÄÚн¨Ò»¸öContext±êÇ©
     <Context path="/learn1" reloadable="true" docBase="E:\work\tech\project\learn1\WebRoot" workDir="E:\work\tech\project\learn1\WebRoot\work" />
      * workDirÊÇÖ¸To ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØÍ¼ | ¸ÓICP±¸09004571ºÅ