jsp ´æºº×Öµ½mysql³öÏÖÂÒÂë - Java / Web ¿ª·¢
ÎÒÔÚÒ³Ãæ»ñÈ¡µÄºº×Ö£¬Í³±àÂ붼ÊÇGBK£¬Êý¾Ý¿â±àÂëÒ²ÊÇGBk£¬Êý¾Ý¿âÁ¬½Ó×Ö·ûÒ²Ö¸¶¨defaultEncoding=gbk
request.setCharacterEncoding("GBK");Ò²ÓÃÁË£¬²¢ÔÚÆÁÄ»ÉÏÊä³öҲû³öÏÖÂÒÂ룬µ«ÊÇÒ»´æ½øÊý¾Ý¿â¾Í³öÏÖÂÒÂëÁ˵«´æ½øÊý¾Ý¿âµÄºº×Ö¾ÍÊÇÒ»¶ÑÎʺš£Ï£Íû´ó¼Ò°ï°ï棻
ÄãÓõÄʲô»·¾³?
´ÓÊý¾Ý¿âÀï¶Á³öÀ´µ½Ç°Ì¨»áÂÒÂëÂð?
´Óºǫ́¶Á²»ÂÒÂ룬¸üÐÂʱ»ò²åÈëʱ»á³öÏÖÂÒÂë¡£ÎÒÓÃNEtbeans
ÕⶫÎ÷»ù±¾¿ÉÒÔËãûÓùý, ÓÃmyeclipse¶¼.! ÄǹÀ¼ÆÊÇÄã»·¾³µÄÎÊÌâÁË.!
½¨ÒéÓÃutf-8ÊÔÊÔ
¶Ô½¨ÒéÄãÓÃMyeclipse£¬²¢ÇÒÏÖÔÚ¹«Ë¾¿ª·¢¶¼ÊÇÓõÄMyEclipseÁË!
Õâ¸öÎÊÌâÎÒÒ²Óöµ½¹ý
²é³öÀ´ÏÔʾûÎÊÌâ ´æ½øÈ¥¾ÍÂÒÂë
±àÂëÿ¸öµØ·½¶¼Éè¼ÆÁË.
¼ÇµÃÎÒÕâÑùŪµÄ
String name=request.getParameter("name");
name=new String(name.getBytes("ISO8859_1");
È»ºó´æ½øÈ¥¾ÍûÎÊÌâÁË
ÆäʵÂÒÂë×î¼òµ¥µÄ½â¾ö°ì·¨ÊÇŪ¸öfilter
ÒÔºó¾Í¿ÉÒÔ¸ßÕíÎÞÓÇÁË..
ͼƬÔõô²»ÏÔʾÄØ
Á½¸ö»·¾³²»Ò»Ñù£¬¸Ä³ÉÒ»ÑùµÄÊÔÊÔ¡£
ÄãÔÚ°²×°Êý¾Ý¿âµÄ¹ý³ÌÖÐûÓÐÉèÖÃ×Ö·û±àÂ룬ÕýÈç10Â¥ÄǸöͼÄÇÑùÉèÖá£
ÉèÖÃÍêÖ®ºóÓ¦¸Ã¾ÍûÎÊÌâÀ²
ºÜÎÞÁ¦µÄ˵£¬´ÓÂòÕûºÃ¹ýÕâСÊý¾Ý¿âµÄÂÒÂëÎÊÌ⡣ʵ¼Ê¿ª·¢Ò²Ã»ÓùýËü£¬Ò»Ö±ÊÇÓü׹ÇÎÄ¡£
Mysql ÖгýÁË¿â¡¢±íÒÔÍ⣬ÿ¸ö×Ö¶ÎÒ²ÊÇ¿ÉÒÔµ¥¶ÀÉèÖñàÂëµÄ£¬Â¥Ö÷¿´¿´¾ßÌå×ֶεıàÂëÊDz»ÊÇÓÐÎÊÌâ
Èç¹ûÊý¾Ý¿âÂÒÂëµÄ»°Ê¹ÓÃ10#µÄ·½·¨£¬Èç¹ûÒ³ÃæÂÒÂëµÄ»°;
ÔÚÒ³ÃæÉϼӸörequest.setCharacter
Ïà¹ØÎÊ´ð£º
µ±ÖªµÀÒ»¸öÈÕÆÚ£¬ÈçºÎ°ÑÕâ¸öÈÕÆÚËùÔÚÑ®µÄÇ°ºóÁ½¸öÈÕÆÚÈ¡³ö
±ÈÈçÊäÈë20090905£¬¾ÍÊäÈë20090901 20090910
Êä³ö20090901 20090910
È¡µÃÌìÊýºó×÷Ò»ÏÂÅжÏÔÙ°ÑÕâ¸ö·½·¨ÓÃÏÂvoid set(int field, int value)
......
JSPÒ³ÃæÖÐÓжà¸öradio°´Å¥
JSPÒ³Ã潫²ÎÊýPOST¸øservlet
ÒªÇóÈçÏÂ;
1.Ñ¡ÔñÒ»¸öradio£¬µ÷ÓÃservlet servletÖиù¾Ý²ÎÊýµ÷ÓÃÆäËû½Ó¿Ú£¬³ý·ÇÑ¡ÖиÃradio²¢µã»÷JSPÖеÄʵР......
ÎÒJSPµÄÒ³ÃæÊÇ£º
<%@ page language="java" contentType="text/html; charset=gb2312"
%>
<script>
function Save(){
xmlHttp=GetXmlHttpObject()
if(xmlHttp==nul ......
ÎÒÊǸöÐÂÊÖ£¬Íû¸ßÊÖ½â´ð
ÎÒÏÖÔÚÒѾ°²×°ÁËmysql£¬Ò²ÓÐmysqlµÄjdbc¡£µ«ÎÒÔõôÅäÖú󣬲ÅÄÜÔÚMyEclipseÀï²Ù×÷mysqlÄØ£¿Çë¸ßÊÖ˵Ïêϸµã
´ò¿ªMyeclipse----window---open perspective---MyEclipse database explorer-- ......
È磺 @superwaring("unchecked");
Õâ¸öÀïÃ涼¿ÉÒÔÈ¡ÄÄЩֵ°¡£¬»¹ÓÐÀàËÆµÄ @superwaring±êÇ©ÓÐÄÄЩ°¡
ûÓùý¡£¡£
¿´jeeµÄapi
javax.persistenceÀï
@superwaring("unchecked");Ö»ÊǺöÂÔ ......