jspµÄpageEncodingºÍcontentType
pageEncodingÊÇjspÎļþ±¾ÉíµÄ±àÂë
contentTypeµÄcharsetÊÇÖ¸·þÎñÆ÷·¢Ë͸ø¿Í»§¶ËʱµÄÄÚÈݱàÂë
JSPÒª¾¹ýÁ½´ÎµÄ“±àÂ딣¬µÚÒ»½×¶Î»áÓÃpageEncoding£¬µÚ¶þ½×¶Î»áÓÃutf-8ÖÁutf-8£¬µÚÈý½×¶Î¾ÍÊÇÓÉTomcat³öÀ´µÄÍøÒ³£¬ ÓõÄÊÇcontentType¡£
µÚÒ»½×¶ÎÊÇjsp±àÒë³É.java£¬Ëü»á¸ù¾ÝpageEncodingµÄÉ趨¶ÁÈ¡jsp£¬½á¹ûÊÇÓÉÖ¸¶¨µÄ±àÂë·½°¸·Òë³ÉͳһµÄUTF-8 JAVAÔ´Â루¼´.java£©£¬Èç¹ûpageEncodingÉ趨´íÁË£¬»òûÓÐÉ趨£¬³öÀ´µÄ¾ÍÊÇÖÐÎÄÂÒÂë¡£
µÚ¶þ½×¶ÎÊÇÓÉJAVACµÄJAVAÔ´ÂëÖÁjava byteCodeµÄ±àÒ룬²»ÂÛJSP±àдʱºòÓõÄÊÇʲô±àÂë·½°¸£¬¾¹ýÕâ¸ö½×¶ÎµÄ½á¹ûÈ«²¿ÊÇUTF-8µÄencodingµÄjavaÔ´Âë¡£
JAVACÓÃUTF-8µÄencoding¶ÁÈ¡javaÔ´Â룬±àÒë³ÉUTF-8 encodingµÄ¶þ½øÖÆÂ루¼´.class£©£¬ÕâÊÇJVM¶Ô³£Êý×Ö´®ÔÚ¶þ½øÖÆÂ루java encoding£©ÄÚ±í´ïµÄ¹æ·¶¡£
µÚÈý½×¶ÎÊÇTomcat£¨»òÆäµÄapplication container£©ÔØÈëºÍÖ´Ðн׶ζþµÄÀ´µÄJAVA¶þ½øÖÆÂ룬Êä³öµÄ½á¹û£¬Ò²¾ÍÊÇÔÚ¿Í»§¶Ë¼ûµ½µÄ£¬ÕâʱÒþ²ØÔڽ׶ÎÒ»ºÍ½×¶Î¶þµÄ²ÎÊýcontentType¾Í·¢»ÓÁ˹¦Ð§
contentTypeµÄ設¶¨.
pageEncoding ºÍcontentTypeµÄÔ¤É趼ÊÇ ISO8859-1. ¶øËæ±ãÉ趨ÁËÆäÖÐÒ»¸ö, ÁíÒ»¸ö¾Í¸ú×ÅÒ»ÑùÁË(TOMCAT4.1.27ÊÇÈç´Ë). µ«Õâ²»ÊǾø¶ÔµÄ, ÕâÒª¿´¸÷×ÔJSPCµÄ´¦Àí·½Ê½. ¶øpageEncoding²»µÈÓÚcontentType, ¸üÓÐÀûÑÇÖÞÇøµÄÎÄ×Ö CJKVϵJSPÍøÒ³µÄ¿ª·¢ºÍչʾ, (ÀýpageEncoding=GB2312 ²»µÈÓÚ contentType=utf-8)¡£
jspÎļþ²»Ïñ.java£¬.javaÔÚ±»±àÒëÆ÷¶ÁÈëµÄʱºòĬÈϲÉÓõÄÊDzÙ×÷ϵͳËùÉ趨µÄlocaleËù¶ÔÓ¦µÄ±àÂ룬±ÈÈçÖйú´ó½¾ÍÊÇGBK£¬Ì¨Íå¾ÍÊÇBIG5»òÕßMS950¡£¶øÒ»°ãÎÒÃDz»¹ÜÊÇÔÚ¼Çʱ¾»¹ÊÇÔÚueÖÐд´úÂ룬Èç¹ûûÓо¹ýÌرðתÂëµÄ»°£¬Ð´³öÀ´µÄ¶¼ÊDZ¾µØ±àÂë¸ñʽµÄÄÚÈÝ¡£ËùÒÔ±àÒëÆ÷²ÉÓõķ½·¨¸ÕºÃ¿ÉÒÔÈÃÐéÄâ»úµÃµ½ÕýÈ·µÄ×ÊÁÏ¡£
µ«ÊÇjspÎļþ²»ÊÇÕâÑù£¬ËüûÓÐÕâ¸öĬÈÏתÂë¹ý³Ì£¬µ«ÊÇÖ¸¶¨ÁËpageEncoding¾Í¿ÉÒÔʵÏÖÕýȷתÂëÁË¡£
¾Ù¸öÀý×Ó:
<%@ page contentType="text/html;charset=utf-8" %>
´ó¶¼»á´òÓ¡³öÂÒÂ룬ÒòΪÊäÈëµÄ“ÄãºÃ”ÊÇgbkµÄ£¬µ«ÊÇ·þÎñÆ÷ÊÇ·ñÕýÈ·×¥µ½“ÄãºÃ”²»µÃ¶øÖª¡£
µ«ÊÇÈç¹û¸ü¸ÄΪ
<%@ page contentType="text/html;charset=utf-8" pageEncoding="GBK"%>
ÕâÑù¾Í·þÎñÆ÷Ò»¶¨»áÊÇÕýÈ·×¥µ½“ÄãºÃ”ÁË¡£
³ö´¦£ºhttp://blog.csdn.net/sunboard/archive/2008/12/23/3587855.aspx
Ïà¹ØÎĵµ£º
ÎÒÏÖÔÚ¸øÄãÒ»¸öJAVAºÍJSPÖ®¼äµÄ¹Øϵ,ÒÔ¼°JAVAµÄÍêÕûÈÏʶ
JAVA·ÖΪJ2EE,J2SE.J2ME,ÏÂÃæ·Ö±ð½éÉÜ:
Ò».J2EE£ºJava 2 Platform Enterprise Edition ÆóÒµ°æ£¬ÓÃÓÚÆóÒµÓ¦Óã¬Ö§³Ö·Ö²¼Ê½²¿Êð¡£
J2EEƽ̨ÓÉÒ»ÕûÌ×·þÎñ£¨Services£©¡¢Ó¦ÓóÌÐò½Ó¿Ú£¨APIs£©ºÍÐÒé¹¹³É£¬
Ëü¶Ô¿ª·¢»ùÓÚWebµÄ¶à²ãÓ¦ÓÃÌṩÁ˹¦ÄÜÉϵÄÖ§³Ö¡£Ëü°ü ......
ÏîÄ¿ÒªÇ󽫺ǫ́Êý¾Ý½øÐÐÏÔʾ£¨ÏÔʾҪÇ󲿷ÖÄÚÈݽøÐÐÁÐÏîºÏ²¢£©£¬ÔÚ¶ÔÏÔʾµÄÊý¾Ý½øÐе¼³ö³Éexcel
ʵÏÖ¹ý³Ì
1¡¢²éѯºÍµ¼³öµÄjspÒ³Ãæ ¹Ø¼ü´úÂë
<script language=javascript>
function exportExcel(){
/****ʵÏÖ·½·¨Ò»
<%-- var curTbl = document.getElementById("techQueryTab"); --%>
<%-- ......
jspÁ¬½Ósql server2005
£¨¾²âÊÔÁ¬½Ó³É¹¦£©
½Ó´¥Java»òÕßJSP£¬ÄÑÃâ»áʹÓõ½Êý¾Ý¿â
SQL Server
2000/2005£¨ÎÒʹÓÃ2005±ê×¼°æ[9.0.3054]²âÊÔ£©£¬¾¹ý×Ô¼ºµÄËÑË÷ºÍÑо¿£¬Ê¹ÓÃJDBCÁ¬½ÓSQL
Server³É¹¦£¬ÌØ´ËÕûÀí·½·¨£¨Ê¹ÓÃEclipse 3.2£©ÈçÏ¡£
×¼±¸¹¤×÷
Ê×ÏÈ£¬²Ù×÷ϵͳ
Öа²×°ºÃSQL Server
2000/2005£¬È ......
jspÂÒÂë½â¾ö(תÔØ)
jspÂÒÂë½â¾ö(תÔØ)
JAVA֪ʶ 2009-04-14 08:49 ÔĶÁ935 ÆÀÂÛ5
GBK±àÂë
GBK±àÂëÊÇÖйúÖƶ©µÄ¡¢µÈͬÓÚUCSµÄеÄÖÐÎıàÂëÀ©Õ¹¹ú¼Ò±ê×¼¡£GBK¹¤×÷С×éÓÚ1995Äê10Ô£¬Í¬Äê12ÔÂÍê³ÉGBK¹æ·¶¡£¸Ã±àÂë±ê×¼¼æÈÝGB2312£¬¹²ÊÕ¼ºº×Ö21003¸ö¡¢·ûºÅ883¸ö£¬²¢Ìṩ1 ......
½ñÌìÔÚÈçÏ´úÂëÖУº
********************************************************
<p><font color="blue">²Ù×÷²½Ö裺1¡¢Ñ¡ÔñÊä³ö¿ÉÑ¡Ïî 2¡¢²éѯ 3¡¢Êä³ö
<br>
************************************************** ......