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

java ÏÂÔØÎļþ·½·¨´óÈ«


jspÖÐʵÏÖÎļþÏÂÔصÄ×î¼òµ¥µÄ·½Ê½ÊÇÔÚÍøÒ³ÉÏ×ö³¬¼¶Á´½Ó£¬È磺<a href="music/abc.mp3">µã»÷ÏÂÔØ</a>¡£µ«ÊÇÕâÑù·þÎñÆ÷ÉϵÄĿ¼×ÊÔ´»áÖ±½Ó±©Â¶¸ø×îÖÕÓû§£¬»á¸øÍøÕ¾´øÀ´Ò»Ð©²» °²È«µÄÒòËØ¡£Òò´Ë¿ÉÒÔ²ÉÓÃÆäËü·½Ê½ÊµÏÖÏÂÔØ£¬¿ÉÒÔ²ÉÓãº1¡¢RequestDispatcherµÄ·½Ê½½øÐУ»2¡¢²ÉÓÃÎļþÁ÷Êä³öµÄ·½Ê½ÏÂÔØ¡£
1¡¢²ÉÓÃRequestDispatcherµÄ·½Ê½½øÐÐ
            jspÒ³ÃæÖÐÌí¼ÓÈçÏ´úÂ룺
           <%
      response.setContentType("application/x-download");//ÉèÖÃΪÏÂÔØapplication/x-download
      String filedownload = "/ÒªÏÂÔصÄÎļþÃû";//¼´½«ÏÂÔصÄÎļþµÄÏà¶Ô·¾¶
      String filedisplay = "×îÖÕÒªÏÔʾ¸øÓû§µÄ±£´æÎļþÃû";//ÏÂÔØÎļþʱÏÔʾµÄÎļþ±£´æÃû³Æ
      filenamedisplay = URLEncoder.encode(filedisplay,"UTF-8");
      response.addHeader("Content-Disposition","attachment;filename=" + filedisplay);
    
      try
      {
          RequestDispatcher dis = application.getRequestDispatcher(filedownload);
          if(dis!= null)
          {
              dis.forward(request,response);
          }
          response.flushBuffer();
      }
      catch(Exception e)
      {
          e.printStackTrace();
      }
      finally
      {
    
      }
%>
2¡¢²ÉÓÃ


Ïà¹ØÎĵµ£º

java·¢ËÍEmail

/**
 ·¢ËÍÓʼþµÄ·½·¨
 @param mailStr  -  ·¢Ë͵ÄÓʼþÌå
**/
 public void sendMail(String mailStr){
       try {
           Security.addProvider(new com.sun.net.ssl.internal.ssl.Provider());
& ......

javaÉú³ÉXMLÎļþ×Ô¶¯»»ÐÐÎÊÌâ

Java codeFormat ft=Format.getRawFormat();
ft.setEncoding("utf-8");
ft.setIndent("    ");//ÉèÖÃËõ½ø
       
XMLOutputter outputter=new XMLOutputter(ft);//ÉèÖÃXML¸ñʽ
Õâλ˵µÄ²»´í£»
ÔÚieÀïÃ棬ËüÄÜ°Ñxml×Ô¶¯½âÎö³ÆÊ÷Ðνṹ£¬ËùÒÔ¿´ÆðÀ´Ã»ÎÊÌ⣬ÔÚ¼Çʱ¾ÀïÃ棬¾Í²»ÐÐÁ ......

javaλÔËËã

JAVAÖÐλÔËËã·û°üÀ¨:    &  |  ~   ^  <<   >>   >>>
Ò»¡¢Ê×ÏÈÒª¸ãÇå³þ²ÎÓëÔËËãµÄÊýµÄλÊý£º
   javaµÄ8ÖÖ»ù±¾ÀàÐÍ£ºbyte,short, char, int, long,float,double,boolean.
   ÔÚÄÚ´æÖй̶¨³¤¶È(×Ö½Ú)£º1&nbs ......

ÓÃJavaÉú³ÉUUID


GUIDÊÇÒ»¸ö128볤µÄÊý×Ö£¬Ò»°ãÓÃ16
½øÖƱíʾ¡£Ëã·¨µÄºËÐÄ˼ÏëÊǽáºÏ»úÆ÷µÄÍø¿¨¡¢µ±µØʱ¼ä¡¢Ò»¸öËæ¼´ÊýÀ´Éú³ÉGUID¡£´ÓÀíÂÛÉϽ²£¬Èç¹ûһ̨»úÆ÷ÿÃë²úÉú10000000¸öGUID£¬Ôò¿ÉÒÔ
±£Ö¤£¨¸ÅÂÊÒâÒåÉÏ£©3240Äê²»Öظ´¡£
UUIDÊÇ1.5ÖÐÐÂÔöµÄÒ»¸öÀ࣬ÔÚjava.utilÏ£¬ÓÃËü¿ÉÒÔ²úÉúÒ»¸öºÅ³ÆÈ«ÇòΨһµÄID
package
com.mytest;
im ......

javaÃæÊÔÌâ¼°´ð°¸

1¡¢ÃæÏò¶ÔÏóµÄÌØÕ÷ÓÐÄÄЩ·½Ãæ
1.³éÏó£º
³éÏó¾ÍÊǺöÂÔÒ»¸öÖ÷ÌâÖÐÓ뵱ǰĿ±êÎ޹صÄÄÇЩ·½Ã棬ÒÔ±ã¸ü³ä·ÖµØ×¢ÒâÓ뵱ǰĿ±êÓйصķ½Ãæ¡£³éÏó²¢²»´òËãÁ˽âÈ«²¿ÎÊÌ⣬¶øÖ»ÊÇÑ¡ÔñÆäÖеÄÒ»²¿·Ö£¬ÔÝʱ²»Óò¿·Öϸ½Ú¡£³éÏó°üÀ¨Á½¸ö·½Ã棬һÊǹý³Ì³éÏ󣬶þÊÇÊý¾Ý³éÏó¡£
2.¼Ì³Ð£º
¼Ì³ÐÊÇÒ»ÖÖÁª½áÀàµÄ²ã´ÎÄ£ÐÍ£¬²¢ÇÒÔÊÐíºÍ¹ÄÀøÀàµÄÖØ ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ