jspÒ³Ãæ URL´«ÖÐÎIJÎÊýµ½ActionÀïÃæ³öÏÖÂÒÂë
½â¾ö·½·¨£º
µÚÒ»ÖÖ£ºÔÚActionÖÐÓà new String(str.getBytes("ISO8859_1"), "UTF8")£¬½øÐÐתÂ룬ÒòΪ´«µÝµÄʱºò£¬ÖÐÎÄĬÈ˵ÄÊÇISO8859_1
µÚ¶þÖÖ£º¿Éͨ¹ýÅäÖÃTOMCATÀ´½â¾ö´ËÎÊÌ⣬¾ßÌå½â¾ö·½·¨ÈçÏ£ºÔÚtomcatµÄserver.xmlÀÕÒµ½<Connector port="8080" useBodyEncodingForURI="true" URIEncoding="utf-8">
ÆäÖÐÊÇÐÞ¸ÄuseBodyEncodingForURI="true" URIEncoding="utf-8" Æä·½·¨ÊÇ·ÀÖ¹ÔÚurlÖгöÏÖÂÒÂë
È»ºóÔÚÿ¸öJspÒ³ÃæÌí¼ÓÈçÏ´úÂë
<%@ page pageEncoding=” utf-8″%>
<%@ page contentType=”text/html;charset= utf-8″%>
<%request.setCharacterEncoding(” utf-8″);%>
Ïà¹ØÎĵµ£º
Ê×ÏÈ£¬ËµËµJSP/ServletÖеö±àÂëµÄ×÷Óá£
ÔÚJSP/ServletÖÐÖ÷ÒªÓÐÒÔϼ¸¸öµØ·½¿ÉÒÔÉèÖñà Â룬pageEncoding="UTF-8"¡¢contentType="text/html;charset=UTF-8"¡¢request.setCharacterEncoding("UTF-8")ºÍ response.setCharacterEncoding("UTF-8")£¬ÆäÖÐǰÁ½¸ ......
Properties properties = new Properties();
File file = new File(request.getRealPath("/") +"\\WEB-INF\\classes\\configs.properties");
FileInputStream fiStream = new FileInputStream(file);
InputStreamRe ......
Ò»¡¢ÔÚJSPÒ³ÃæÖжÁÈ¡±¾µØÎļþÄÚÈÝ£º
<%
try {
BufferedReader in = new BufferedReader(new FileReader("D:/test.txt"));
String file = "";
String temp = "";
&n ......
µ±ÄãÔÚ¿Í»§¶ËÓÃview source¿´JSPÉú³ÉµÄ´úÂëʱ£¬»á·¢ÏÖÓкܶà¿ÕÐУ¬ËûÃÇÊÇÓÉ< %...% >ºóµÄ»Ø³µ»»ÐжøÉú³ÉµÄ£¬Ò²¾ÍÊÇ˵ÿһÐÐÓÉ< %...% >°üº¬µÄJSP´úÂëµ½¿Í»§¶Ë¶¼±ä³ÉÒ»¸ö¿ÕÐУ¬ËäÈ»²»Ó°Ïìä¯ÀÀ£¬µ«»¹ÊÇÏ£ÍûÄܰÑËûÃÇɾµô¡£ÕâÀォΪ´ó¼Ò½éÉÜÈçºÎɾ³ýJSP±àÒëºóµÄ¿ÕÐС£
Tomcatɾ³ýJSP±àÒëºóµÄ¿ÕÐа취ÈçÏ£º
1. ......
ǰÑÔ
ÔÚʹÓÃÊý¾Ý¿âµÄ¹ý³ÌÖУ¬²»¿É±ÜÃâµÄÐèҪʹÓõ½·ÖÒ³µÄ¹¦ÄÜ£¬¿ÉÊÇJDBCµÄ¹æ·¶¶Ô´ËȴûÓкܺõĽâ¾ö¡£¶ÔÓÚÕâ¸öÐèÇóºÜ¶àÅóÓѶ¼ÓÐ×Ô¼ºµÄ½â¾ö·½°¸£¬±ÈÈçʹÓÃVectorµÈ¼¯ºÏÀàÏȱ£´æÈ¡³öµÄÊý¾ÝÔÙ·ÖÒ³¡£µ«ÕâÖÖ·½·¨µÄ¿ÉÓÃÐԺܲÓëJDBC±¾ÉíµÄ½Ó¿ÚÍêÈ«²»Í¬£¬¶Ô²»Í¬ÀàÐ͵Ä×ֶεÄÖ§³ÖÒ²²»ºÃ¡£ÕâÀïÌṩÁËÒ»ÖÖÓëJDBC¼æÈÝÐԷdz£ºÃµÄ·½°¸ ......