javaÏîÄ¿ java webÏîÄ¿Êý¾Ý¿âÂÒÂëÎÊÌâµÄ½â¾ö°ì·¨
×÷Ϊjava²ËÄñ£¬ÔÚѧϰµ½Êý¾Ý¿â²Ù×÷µÄʱºòÍùÍù»áÓöµ½Ò»¸öºÜÍ·Í´µÄÎÊÌ⣬Êý¾Ý¿âÖÐÎÄÂÒÂë¡£ÕâËƺõÊÇÿ¸öjava³ÌÐòÔ±Ôڳɳ¤¹ý³ÌÖж¼»áÓöµ½µÄÎÊÌ⣬ÏÂÃæÎҾͰÑÎÒ×Ô¼ºµÄ¼¸ÖÖ·½·¨ºÍ´ó¼Ò·ÖÏíһϡ££¨Ò»°ãÊÇÔÚMyEclipseÏ¿ª·¢£©
javaÏîÄ¿£º
Ê×ÏÈ£¬È·±£ÏîÄ¿µÄ±àÂëÊÇgbk»òutf-8(),ÔÚWindows->Preferences->General->WorkplaceÀï¿ÉÒÔÉèÖá£
Èç¹ûÏîÄ¿ÊÇͨ¹ýxmlÎļþÅäÖÃÊý¾Ý¿â£¨±ÈÈçhibernateÖ®ÀàµÄ¿ò¼Ü£¬·½±ãÊý¾Ý¿âµÄÇл»£©£¬ÔÚÊý¾Ý¿âÁ¬½ÓÓï¾äÈ磺jdbc:mysql://localhost/test1ºó¼ÓÉÏ?characterEncoding=gb2312±ä³É
jdbc:mysql://localhost/test1?characterEncoding=gb2312¡£
×îºó°ÑÊý¾Ý¿âÖеÄ×Ö·û¼¯ÐÞ¸ÄΪgbk2312£¬×Ö·ûЧÑégbk_general_ci»òutf-8,utf_general_ci.
ºÃÁ˲âÊÔһϰɣ¬Èç¹ûÓпÉÊÓ»¯²Ù×÷½çÃæÈçnavicat¾ÍÄÜ¿´µ½ÖÐÎÄÊý¾ÝÁË£¬Èç¹ûÊÇdosϲ鿴µÄ»°£¬ÖÐÎÄ»¹ÊÇ“£¿£¿”£¬²»Òª×ż±ÔÙ²éÊý¾Ý֮ǰÔËÐÐ set names gbk£»ÔÙ²é¾ÍOKÁË¡£
java webÏîÄ¿£º
Íê³ÉÈçÉÏjavaÏîÄ¿µÄÉèÖá£
È·±£jspÒ³µÄ±àÂëΪutf-8¡£
¼ÓÈëÈ«Õ¾ÖÐÎĹýÂËÆ÷£¬¹ýÂËÆ÷servlet´úÂëÈçÏÂ
---------EncodingFilter .java-------
package info.filter;
import java.io.IOException;
import java.util.StringTokenizer;
import javax.servlet.Filter;
import javax.servlet.FilterChain;
import javax.servlet.FilterConfig;
import javax.servlet.ServletException;
import javax.servlet.ServletRequest;
import javax.servlet.ServletResponse;
import javax.servlet.http.HttpServletResponse;
public class EncodingFilter implements Filter {
protected String encoding = null;
protected FilterConfig config;
public void init(FilterConfig filterConfig) throws ServletException {
this.config = filterConfig;
this.encoding = filterConfig.getInitParameter("Encoding");
}
public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException,ServletException {
if (request.getCharacterEncoding() == null) {
String encode = getEncoding();
if (encode != null)
request.setCharact
Ïà¹ØÎĵµ£º
java¹¤×÷ÕßÉçÇøÖ÷°ì
1. ¡¾¸´Ñ¡¡¿ÊÕÈëÓÐÕÇ£¬ÓиÉÍ·
22.22%
2. ¡¾¸´Ñ¡¡¿ÊÕÈë²»ÀÖ¹Û£¬Ã»¸ÉÍ·
8.89%
3. ¡¾µ¥Ñ¡¡¿ÄêÊÕÈë50ÍòÒÔÉÏ
2.22%
4. ¡¾µ¥Ñ¡¡¿ÄêÊÕÈë20Íò~50Íò
4.44%
5. ¡¾µ¥Ñ¡¡¿ÄêÊÕÈë10Íò~20Íò ......
ÔÎÄÀ´×Ô£ºIT¹¤³Ì¼¼ÊõÍø£¬www.systhinker.com
Õ»Óë¶Ñ¶¼ÊÇJavaÓÃÀ´ÔÚRamÖдæ·ÅÊý¾ÝµÄµØ·½¡£ÓëC++²»Í¬£¬Java×Ô¶¯¹ÜÀíÕ»ºÍ¶Ñ£¬³ÌÐòÔ±²»ÄÜÖ±½ÓµØÉèÖÃÕ»»ò¶Ñ¡£
Õ»Óë¶Ñ¶¼ÊÇJavaÓÃÀ´ÔÚRamÖдæ·ÅÊý¾ÝµÄµØ·½¡£ÓëC++²»Í¬£¬Java×Ô¶¯¹ÜÀíÕ»ºÍ¶Ñ£¬³ÌÐòÔ±²»ÄÜÖ±½ÓµØÉèÖÃÕ»»ò¶Ñ¡£
JavaµÄ¶ÑÊÇÒ»¸öÔËÐÐʱÊý¾ÝÇø,ÀàµÄ¶ÔÏó´ÓÖзÖÅä¿Õ¼ä¡£Õ ......
1.javaÀà¿â×Ô´øµÄ·½·¨£º
1¡¢public boolean isNumber(String str)
{
if(java.lang.Character.isDigit(msg.charAt(0))){
return true;
}
return false;
}
}
2.¸üУºÓÃÕýÔò±í´ïʽ
Ê×ÏÈÒªimport java.util.regex.Pattern ºÍ java.util.regex.Matcher
ÕâÁ½¸ö°ü£¬»òÕß²»µ¼ ......
ÎÒ»Ò³£¼¦¶³£¬ACÁËÒ»¸ö188ÈËACµÄÌâÄ¿£¬¿ªÊ¼ËÀ»îRE£¬ÈÃÈ˲»½ûÄԲУ¬ÀíÂÛÉÏ°´ÌâÄ¿ÃèÊö½ÓÊÕsplitµÄstringÊý×鿪µ½2×ã×ã¹»£¬µ«ÊÇHH´óÅ£»¹ÊÇÖ´×ŵÄÌá³öÁËÊý×éÔ½½çµÄ¿ÉÄÜ£¬ºóÀ´¿´ÄǸö´óСΪ5µÄÊý×éÓеãÌ«¸ðÀĘ̂£¬Ë÷ÐԸijÉ105(¿ÉÊÇÃ÷Ã÷2¸ö¾Í¹»ÁË°¡£¬°¡£¬°¡£¬°¡£¬f**k)£¬È»ºó½»£ºAC£¬¿¿¡£ÄÔ²Ð+1£¬Ôôô¿ÉÄÜÄØ£¡ÄѵÀÌâÄ¿ÃèÊöÓÖÔÚÍæÈË£¬ ......
GRASPģʽ:General Responsibility Assignment Software Patterns£ºÍ¨ÓÃÔðÈηÖÅäÈí¼þģʽ
ÀïÃæÖØÒªµÄ¸ÅÄîÊÇÔðÈΣ¬ÔðÈÎÊÇÀà¼äµÄÒ»ÖÖºÏÔ¼»òÊÇÒåÎñ£¬¿ÉÒÔϸ·ÖΪÁ½²¿·Ö£¬Óù«Ê½±íʾÈçÏ£º
ÔðÈÎ = ÖªµÀÔðÈÎ + ÐÐΪÔðÈΣ¨ÕâÀïÃæËƺõ´æÔÚ¸ÅÄîµÄÑ»·¶¨Ò壩
×¢£ºÓÃͨË׵Ļ°À´½²£¬ÔðÈξÍÊÇÒ»¸öÀàÖªµÀÒª×öʲô£¬²¢ÇÒÄܹ»×öʲô¡£
· ......