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

java servlet ÂÒÂë

javaдÎļþÂÒÂë
StringBuffer sb = new StringBuffer();
  sb.append("<table  border=\"0\" width=\"100%\" cellpadding=\"0\" cellspacing=\"1\" bgcolor=\"b5d6e6\"");
  sb.append("<tr>");
  sb.append("<td bgcolor=\"#FFFFFE\" height=\"42\" colspan=\""+ (jsd.size()+1) +"\" align=\"center\"><b>" +    dataSet.getTitle() + "</b></td>");
  sb.append("</tr>");
  sb.append("</tr>");
  sb.append("</table>");
  return sb.toString();
½â¾ö·½·¨
ʹÓÃ
public static String ISOToInnerCode(String str) {
        if (str == null)
            return null;
        try {
            str = (new String(str.getBytes("ISO-8859-1"), "UTF-8")).trim();
        } catch (Exception ex) {
        }
        return str;
    }
ÈôÊÇÔÚservletÖÐÔòʹÓÃ
request.setCharacterEncoding("UTF-8");
   response.setContentType("text/html;charset=utf-8"); 
    PrintWrite out=response.getWrite();
Èç¹ûÊÇ
OutputStream out = response.getOutputStream();
Êä³öʱÓÃout.write(Content.getBytes("utf-8"));¼´Ôö¼ÓÒ»ÖÖ±àÂë utf-8Ò²¿É¸Ä³ÉÆäËû±àÂëgbk,gb2312µÈ ÒÀ×Ô¼ºÇé¿ö¶ø¶¨
Èç¹û½ÓÊÜ´«²ÎÊýʱÂÒÂë Ö»Ðè°Ñ response.setContentType("text/html;charset=utf-8"); 
¸Ä³Éresponse.setCharacterEncoding("UTF-8");


Ïà¹ØÎĵµ£º

ÔÚJava³ÌÐòÖнػñ¿ØÖÆÌ¨Êä³ö

     ±¾ÎĵÄÄ¿±êÊÇÉè¼ÆÒ»¸ö»ùÓÚSwingµÄJTextAreaÏÔʾ¿ØÖÆÌ¨Êä³ö¡£´ËÆÚ¼ä£¬ÎÒÃÇ»¹½«ÌÖÂÛһЩºÍJava¹ÜµÀÁ÷£¨PipedInputStreamºÍPipedOutputStream£©ÓйصÄ×¢ÒâÊÂÏî¡£×îºó»¹Òª´´½¨Ò»¸öÄܹ»²¶»ñºÍÏÔʾÆäËû³ÌÐò£¨¿ÉÒÔÊÇ·ÇJavaµÄ³ÌÐò£©¿ØÖÆÌ¨Êä³öµÄ¼òµ¥³ÌÐò¡£
Ò»¡¢Java¹ÜµÀÁ÷
     ÒªÔÚÎı¾ ......

Java½âÎöÍøÂçÊý¾ÝÁ÷µÄÈýÖÖÌØÊâ·½·¨

Ò»¡¢UTF8ת»»³ÉGB2312
       
µ±ÎÒÃÇÔÚ»ùÓÚHTTPЭÒéµÄJSP»òServletµÄÓ¦ÓÃÖлñÈ¡Êý¾Ý»ò·¢ËÍÇëÇóʱ£¬JVM»á°ÑÊäË͵ÄÊý¾Ý±àÂë³ÉUTF8¸ñʽ¡£Èç¹ûÎÒÃÇÖ±½Ó´ÓHTTPÁ÷ÖÐÌáÈ¡ÖÐÎÄÊý¾Ý£¬ÌáÈ¡µÄ½á¹ûΪ“????”£¨¿ÉÄܸü¶àÎʺţ©£¬Îª×ª»»³ÉÎÒÃÇÄܹ»Àí½âµÄÖÐÎÄ×Ö·û£¬ÎÒÃÇÐèÒª°ÑUTF8ת»»³É ......

javaÖÐThreadÏß³ÌÖÐµÄ start£¨£©ºÍrun£¨£©·½·¨µÄÇø±ð


Á½ÖÖ½¨Á¢Ï̶߳ÔÏóµÄ·½·¨£º
    Extends Thread
    implement Runnable
   ÕâÁ½ÖÖ·½·¨¶¼¿ÉÒÔ´´½¨Ò»¸öÏ̶߳ÔÏó£¬
public class TestThread {
    public static void main(String arg[]){
        newThread thread = new ne ......

һЩ³£¼ûJavaÒì³£¹éÀà(Ò»)

UnsupportedClassVersionError
¡¡¡¡²»Ö§³ÖµÄÀà°æ±¾´íÎó¡£µ±JavaÐéÄâ»úÊÔͼ´Ó¶Áȡij¸öÀàÎļþ£¬µ«ÊÇ·¢ÏÖ¸ÃÎļþµÄÖ÷¡¢´Î°æ±¾ºÅ²»±»µ±Ç°JavaÐéÄâ»úÖ§³ÖµÄʱºò£¬Å׳ö¸Ã´íÎó¡£
¡¡¡¡java.lang.VerifyError
¡¡¡¡ÑéÖ¤´íÎó¡£µ±ÑéÖ¤Æ÷¼ì²âµ½Ä³¸öÀàÎļþÖдæÔÚÄÚ²¿²»¼æÈÝ»òÕß°²È«ÎÊÌâʱÅ׳ö¸Ã´íÎó¡£
¡¡¡¡java.lang.VirtualMachineErr ......

java·ºÐ͵ÄÀí½â

·ºÐÍÊÇJava SE 1.5µÄÐÂÌØÐÔ£¬·ºÐ͵ı¾ÖÊÊDzÎÊý»¯ÀàÐÍ£¬Ò²¾ÍÊÇ˵Ëù²Ù×÷µÄÊý¾ÝÀàÐͱ»Ö¸¶¨ÎªÒ»¸ö²ÎÊý¡£ÕâÖÖ²ÎÊýÀàÐÍ¿ÉÒÔÓÃÔÚÀà¡¢½Ó¿ÚºÍ·½·¨µÄ´´½¨ÖУ¬·Ö±ð³ÆÎª·ºÐÍÀà¡¢·ºÐͽӿڡ¢·ºÐÍ·½·¨¡£
¡¡¡¡JavaÓïÑÔÒýÈë·ºÐ͵ĺô¦Êǰ²È«¼òµ¥¡£
¡¡¡¡ÔÚJava SE 1.5֮ǰ£¬Ã»ÓзºÐ͵ÄÇé¿öµÄÏ£¬Í¨¹ý¶ÔÀàÐÍObjectµÄÒýÓÃÀ´ÊµÏÖ²ÎÊýµÄ“È ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØÍ¼ | ¸ÓICP±¸09004571ºÅ