jsp ÖÐÂÒÂëµÄ - Java / Web ¿ª·¢
ÎҵĿª·¢µÄƽ̨ÊÇMyeclipes6.0 + tomcat5.x + mysql
ÎÒËùÓеıàÂ뷽ʽ¶¼ÊÇÓõÄUTF-8
ÎÒÖ»ÓÃÁËStrtus¿ò¼Ü
ÔÚÒ»¸öformÖÐÈçÏÂÓõÄÊÇpostµÄÌá½»·½Ê½£º
<form class="form" action="submitreply.do?id=<%=a.getId() %>&rootId=<%=a.getRootId() %>" method="post">
±êÌ⣺
<input name="title" type="text"/>
<br>
ÄÚÈÝ£º
<textarea name="cont" rows="15" cols="80"></textarea>
<br>
<input class="input_submit" name="submit" type="submit" value="Ìá½»"/>
</form>
È»ºóÎÒÓÃÒ»¸öActionFormÀ´ÊÕ¼¯Êý¾Ý£¬µ«ÊÇÊÕ¼¯µÄÊý¾ÝÊÇÂÒÂ룬¼´Ê¹ÔÚÇëÇóµÄÒ³ÃæÎÒ¼ÓÉÏÁË<%request.setCharacterEncoding("GBK");%>»òÕß<%request.setCharacterEncoding("UTF-8");%> µ«ÊÇÊÕ¼¯µ½µÄÊý¾ÝÒÀÈ»ÊÇÂÒÂ룬×îºó²»µÃ²»ÓÃString cont = new String(afn.getCont().getBytes("ISO-8859-1"),"UTF-8");ÕâÖÖ·½Ê½×ª»»±àÂë²Å¿ÉÒÔ£¬ÎÒ¾õµÄÿһ´Î¶¼ÓÃÕâÖÖ·½Ê½Ì«Âé·³ËùÒÔÇëÄÇλ´óϺÀ´¸øÖ¸µãһϣ¬Ð¡µÜ²»Ê¤¸Ð¼¤£¡£¡£¡
ÄãµÄMYSQLÖÐÊDz»ÊÇÒ²ÊÇUTF-8ѽ£¬¿´Ò»ÏÂÄãµÄMYSQLÖеıàÂë¿ÉÄÜÊÇÕâµÄÎÊÌâ
¶¥
¿´¿´mysqlµÄÅäÖÃÎļþ 57Ðиú81ÐÐÊDz»ÊÇutf-8
ÓùýÂËÆ÷¾ÍºÃÁË£¬ÔÚÍøÉÏÕÒ¸ö¹ýÂËÆ÷°É
Ö±½ÓÔÚtomcateÀïÃæÖе
Ïà¹ØÎÊ´ð£º
ÔÚ²éѯºó½«²éѯ³öÀ´µÄÖµ¸³¸ø¸÷ÊäÈë¿ò
<c:if test="${not empty dataValue}">
fm.SAMPLING_DATE.value=" <c:out value='${dataValue.SAMPLING_DATE}'/ ......
ͨ¹ýjava³ÌÐò£¬ÏȱàÒëc³ÌÐò£¬Èç³öÏÖ´íÎó£¬ÌáʾC³ÌÐòÖеĴíÎ󣬱àÒë³É¹¦¾ÍÔËÐУ¬ÏÔʾCµÄÔËÐнá¹û£¬×îºÃ°ÑCµÄÔËÐÐʱ¼äºÍÄÚ´æµÈ¶¼ÏÔʾ³öÀ´
¸÷λ´ó¸ç´ó½ã°ï°ï棬СµÜ¸Ð¼¤²»¾¡£¡
ÓÃjavaµÄ½ø³ÌÀàÊÔÊÔ
ÎÒ¸øÄãת ......
Ò»¸ö¾²Ì¬µÄhtmlÒ³Ã棬ÃÀ»¯£¬½çÃæ²¼¾ÖÒѾ´¦ÀíºÃÁË £¬ÔÚ±àд³ÌÐòµÄʱºòÐèÒªÔÚת»¯³ÉJSPÒ³Ã棬
ËùÒÔн¨Ò»¸öJSPÒ³Ã棬½²ÔÀ´µÄ´úÂ뿽±´µ½ÀïÃæÈ¥£¬½á¹û²¼¾Ö±äÁË£¿
²»´æÔÚ·¾¶ÎÊÌâ!
ûÈË? Õæʧ°Ü!
......
ÐÂÊÖ£¬¸Õ½Ó´¥xml,ÏÖÔÚÓиöÎÊÌâÐèÒª´ó¼Ò°ïæ~~
ÏîÄ¿ÒªÇóÐèÒªÐ޸ķþÎñÆ÷ÉϵÄxmlÎļþ£¬ÏÖÔÚÒѾÔÚjavascriptÖÐÒÔxmlDoc.load()¶Á³öÁËxmlÎļþÖеÄÄÚÈÝ£¬²¢ÔÚÒ³ÃæÉ϶ÔÆäÄÚÈݽøÐÐÁËһЩÐ޸ġ£xmlÎļþÊÇһЩÕâÑùµÄÐÅÏ¢£º ......
ÕâÊÇÎÒ´ÓIT¹«Ë¾ÃæÊÔÊÖ²áÍøÕ¾ÉÏ¿´µ½µÄÒ»¸öÃæÊÔÌ⣬ËûÃÇÌṩµÄ´ð°¸ÊÇ£º
µ±¿Í»§¶ËÏòÒ»¸öJSPÒ³Ãæ·¢³öÇëÇóʱ£¬Web Container½«JSPת»¯³ÉServletµÄÔ´´úÂë(Ö»ÔÚµÚÒ»´ÎÇëÇóʱ)£¬È»ºó±àÒëת»¯ºóµÄServlet²¢¼ÓÔص½ÄÚ´æÖ ......