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ÖÐɾ³ýĿ¼ÊÂÏÈҪɾ³ýĿ¼ÏµÄÎļþ»ò×ÓĿ¼¡£Óõݹé¾Í¿ÉÒÔʵÏÖ¡£
public void del(String filepath) throws IOException{
File f = new File(filepath);//¶¨ÒåÎļþ·¾¶
if(f.exists() && f.isDirectory()){//ÅжÏÊÇÎļþ»¹ÊÇĿ¼
if( ......
Á½ÖÖ½¨Á¢Ï̶߳ÔÏóµÄ·½·¨£º
Extends Thread
implement Runnable
ÕâÁ½ÖÖ·½·¨¶¼¿ÉÒÔ´´½¨Ò»¸öÏ̶߳ÔÏó£¬
public class TestThread {
public static void main(String arg[]){
newThread thread = new ne ......
1.±ÊÊÔÌâºÜ¼òµ¥£¬¶¼ÊÇһЩ»ù´¡ÖªÊ¶¡£
2.ÓиöÃæÊÔÌâ±»Äѵ¹ÁË£¬¿´ÊÇ·ñÓÐÄÄλ´óÏÀÄܵ㲦µã²¦
¹ØÓÚ´óÈÝÁ¿Îı¾¼ìË÷µÄÎÊÌ⣺һ¸öÎı¾ÎļþÖÐÓм¸Ê®ÍòÌõ»ò¸ü¶àµÄ¼Ç¼£¬¼Ç¼ÒÔÐÐΪµ¥Î»£¬Ã¿ÐеÄÐÅÏ¢ÈçÏ£º
Óû§id£¬Óû§Ãû£¬..........................
ÓÐʲôºÃµ ......
ÏàÐÅ´ó¼Ò¶¼ÓÃjavadocµÄÃüÁîÉú³É¹ýapi help °É£¿µ«ÊÇ°ü×¢ÊÍÔõôÀ´µÄÄØ£¿½ñÌìѧϰԴ´úÂëµÄʱºò·¢ÏÖÁËÕâ¸ö°ü×¢Ê͵ÄÀ´Ô´¡£
±ÈÈ磺org.apache.james.utilÕâ¸öµÄ°ü×¢ÊÍ¡£ÔÚÕâ¸ö°üϱßÓÐÒ»¸öpackage.htmlµÄÎļþ¡£
<body>
<p>A variety of utility classes used inside James.</p>
</body>
ÕâÑùÔÙÓ ......
JAVA±ÊÊÔÌ⾫»ª°æ1.0
public class Test2
{
public static void main(String[] args)
{
Float a = new Float(3.4);
&n ......