java±à³ÌµÄGBK×Ö·û¼¯ÎÊÌâ»ã×Ü
ÔÚ¿ª·¢Ò»¸öjavaµÄ¹ÜÀíϵͳʱ£¬ÖÐÎÄÎÊÌâ³£³£À§ÈÅ×ÅÎÒÃÇ£¬¸ù¾ÝÎҵľÑ飬ÎÞ·ÇΪÏÂÃ漸ÖÖ£»
²½Öè1.oreacle ¿Í»§¶Ë»·¾³±äÁ¿µÄÐ޸ġ£
[ECP_WEB]/oracle$locale
LANG=zh_CN.gbk
LC_CTYPE="zh_CN.gbk"
LC_NUMERIC="zh_CN.gbk"
LC_TIME="zh_CN.gbk"
LC_COLLATE="zh_CN.gbk"
LC_MONETARY="zh_CN.gbk"
LC_MESSAGES="zh_CN.gbk"
LC_PAPER="zh_CN.gbk"
LC_NAME="zh_CN.gbk"
LC_ADDRESS="zh_CN.gbk"
LC_TELEPHONE="zh_CN.gbk"
LC_MEASUREMENT="zh_CN.gbk"
LC_IDENTIFICATION="zh_CN.gbk"
LC_ALL=
²½Öè2.Óû§»·¾³±äÁ¿µÄÐ޸ġ£
[ECP_WEB]/tmcat$locale
LANG=zh_CN.gbk
LC_CTYPE="zh_CN.gbk"
LC_NUMERIC="zh_CN.gbk"
LC_TIME="zh_CN.gbk"
LC_COLLATE="zh_CN.gbk"
LC_MONETARY="zh_CN.gbk"
LC_MESSAGES="zh_CN.gbk"
LC_PAPER="zh_CN.gbk"
LC_NAME="zh_CN.gbk"
LC_ADDRESS="zh_CN.gbk"
LC_TELEPHONE="zh_CN.gbk"
LC_MEASUREMENT="zh_CN.gbk"
LC_IDENTIFICATION="zh_CN.gbk"
LC_ALL=
²½Öè3.tomcatÅäÖõÄ×Ö·û¼¯Ð޸ġ£
confÏÂÅäÖÃÎļþ server.xml ÖÐ:
<Connector port="8080" protocol="HTTP/1.1"
connectionTimeout="20000"
redirectPort="8443" URIEncoding='UTF-8'/>
<!-- A "Connector" using the shared thread pool-->
²½Öè4.ϵͳ¼Ü¹¹´úÂëÀïÃæµÄ¹ýÂËÆ÷×Ö·ûת»»Ð޸ġ£
this.encodingName="GBK";
public void doFilter(ServletRequest request, ServletResponse response,
FilterChain chain) throws IOException, ServletException {
if (this.enable) {
request.setCharacterEncoding(this.encodingName);
}
chain.doFilter(request, response);
}
²½Öè4ÊǸù¾Ýÿ¸öϵͳµÄ×Ö·ûת»»¹ýÂËÆ÷ÖеÄд·¨À´¶¨¡£½ö¹©²Î¿¼£¡
²½Öè5.ϵͳÀïÃæµÄJSPÒ³Ãæ±àÂë¸ñʽͳһת»»ÎªGBK
<%@ page language="java" contentType="text/html; charset=GBK"%>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=GBK">
</head>
²½Öè6¡£Èç¹ûΪstruts2£¬Ôòstrut
Ïà¹ØÎĵµ£º
create PROCEDURE pagelist
@tablename nvarchar(50),
@fieldname nvarchar(50)='*',
@pagesize int output,--ÿҳÏÔʾ¼Ç¼ÌõÊý
@currentpage int output,--µÚ¼¸Ò³
@orderid nvarchar(50),--Ö÷¼üÅÅÐò
@sort int,--ÅÅÐò·½Ê½£¬1±íʾÉýÐò£¬0±íʾ½µÐòÅÅÁÐ
......
¶¨ÒåÔÚÒ»¸öÀàÄÚ²¿µÄÀà½ÐÄÚ²¿À࣬°üº¬ÄÚ²¿ÀàµÄÀà³ÆΪÍⲿÀà¡£
ÄÚ²¿Àà¿ÉÒÔÉùÃ÷public¡¢protected¡¢privateµÈ·ÃÎÊÏÞÖÆ£¬
¿ÉÒÔÉùÃ÷ΪabstractµÄ¹©ÆäËûÄÚ²¿Àà»òÍⲿÀà¼Ì³ÐÓëÀ©Õ¹£¬
»òÕßÉùÃ÷Ϊstatic¡¢finalµÄ£¬Ò²¿ÉÒÔʵÏÖÌض¨µÄ½Ó¿Ú¡£
staticµÄÄÚ²¿ÀàÐÐΪÉÏÏóÒ»¸ö¶ÀÁ¢µÄÀ࣬
·ÇstaticÔÚÐÐΪÉÏÀàËÆÀàµÄÊôÐÔ»ò·½·¨ÇÒ½ûÖ¹ÉùÃ÷s ......
ÔÚ±à³ÌµÄʱºò£¬¾³£Óöµ½ÒªÅжÏÒ»¸ö×Ö·û´®ÖеÄ×Ö·ûÊÇ·ñÊÇÊý×Ö(0-9)
ÏÂÃæÎÒ¸ø´ó¼Ò½éÉܼ¸ÖÖʵÏÖ·½·¨
1.ʹÓÃCharacter.isDigit(char)ÅжÏ
String str = "123abc";
if (!"".equals(str)) {
char num[] = str.toCharArray();//°Ñ×Ö·û´®×ª»»Îª×Ö·ûÊý×é
StringBuffer title = new StringBuffer();//ʹÓÃS ......
Èý¸öѧÉúµ½Ò»¸öË®ÁúÍ·ÏÂÅŶÓÈ¡Ë®£¬ÈýÈ˶¼È¡ÍêË®ºóÒ»ÆðÀ뿪¡£
ÕâÀïÉæ¼°µ½ÈçºÎÅжÏÈý¸öÈ˶¼È¡ÍêË®¡£Èç¹ûÓÃÆÕͨµÄ¾²Ì¬³ÉÔ±£¬ÊƱػáÒªÓÃÎÞÏÞÑ»·À´µÈ´ý¡£¸üºÃµÄ°ì·¨ÊÇÓà wait-notify »úÖÆ¡£Ç°Á½¸öѧÉúÈ¡ÍêË®ºó¶¼ wait£¬×îºóÒ»¸öѧÉúÈ¡ÍêË®ºó notify£¬ÕâÑù¾ÍÄÜÒ»ÆðÀ뿪ÁË¡£ÏÂÃæÊÇ´úÂëʾÀý£º
/**
* Èý¸öѧÉúÅŶÓÈ¡Ë®£¬È¡ÍêºóÒ ......