久久亚洲不卡,久久韩国免费视频,日韩成人在线观看http://www.aygfsteel.com/thinkthink/category/25251.htmlenjoy zh-cnSat, 25 Aug 2007 19:26:08 GMTSat, 25 Aug 2007 19:26:08 GMT60- struts2的增刪改查實現例子http://www.aygfsteel.com/thinkthink/articles/139353.htmlthinkthinkthinkthinkSat, 25 Aug 2007 19:12:00 GMThttp://www.aygfsteel.com/thinkthink/articles/139353.htmlhttp://www.aygfsteel.com/thinkthink/comments/139353.htmlhttp://www.aygfsteel.com/thinkthink/articles/139353.html#Feedback0http://www.aygfsteel.com/thinkthink/comments/commentRss/139353.htmlhttp://www.aygfsteel.com/thinkthink/services/trackbacks/139353.html
代碼連接下載:
http://www.aygfsteel.com/Files/thinkthink/struts-crud.rar
or
http://down1.tomore.com/source/20070826/2007082603045724082.rar

]]> - Struts2的亂碼問題解決http://www.aygfsteel.com/thinkthink/articles/139343.htmlthinkthinkthinkthinkSat, 25 Aug 2007 15:55:00 GMThttp://www.aygfsteel.com/thinkthink/articles/139343.htmlhttp://www.aygfsteel.com/thinkthink/comments/139343.htmlhttp://www.aygfsteel.com/thinkthink/articles/139343.html#Feedback0http://www.aygfsteel.com/thinkthink/comments/commentRss/139343.htmlhttp://www.aygfsteel.com/thinkthink/services/trackbacks/139343.html一. 亂碼問題是web開發過程中基本都要處理的。
二.解決辦法:
1。 統一全部的編碼方式,強烈建議采用“UTF-8”;
例如,jsp 里面的配置為
1
<%@ page contentType="text/html;charset=UTF-8" pageEncoding="UTF-8" %>
2。 對需要在web.xml中配置過濾器(filter)的,也要設置為“UTF-8”;
例如:
package commons.filter;

import javax.servlet.*;
import javax.servlet.http.*;
import java.io.*;
import java.util.*;


public class EncodingFilter extends HttpServlet implements Filter
{
private FilterConfig filterConfig;
private String targetEncoding = "UTF-8";
//Handle the passed-in FilterConfig

public void init(FilterConfig filterConfig) throws ServletException
{
this.filterConfig = filterConfig;
}

//Process the request/response pair
public void doFilter(ServletRequest request, ServletResponse response,

FilterChain filterChain)
{

try
{
request.setCharacterEncoding(targetEncoding);
filterChain.doFilter(request, response);

} catch (ServletException sx)
{
filterConfig.getServletContext().log(sx.getMessage());

} catch (IOException iox)
{
filterConfig.getServletContext().log(iox.getMessage());
}
}

//Clean up resources

public void destroy()
{
filterConfig = null;
targetEncoding = null;
}
}

3. 如果不用“UTF-8”,你會發現在使用AJAX提交數據時,URL中的中文在服務器端是亂碼,因為AJAX是以“UTF-8”編碼提交數據的。
4.關于國際化屬性文件(xxxxx.properties), 因為需要unicode編碼,建議使用PropertiesEditor國際化插件進行編輯,他會自動存為unicode編碼。
關于這個PropertiesEditor國際化插件,我下載的時候發現只有for eclipse3.0的, 如果用的eclipse版本是3.2,,3.3根本不行,于是只有下載standone 方式的PropertiesEditor,在cmd下運行: java -jar PropertiesEditor.jar
5.如果發現數據庫數據也有亂碼,記得正確設置數據庫的編碼方式

]]>
主站蜘蛛池模板:
黑水县|
徐水县|
根河市|
金秀|
南召县|
类乌齐县|
客服|
汾阳市|
额尔古纳市|
县级市|
石阡县|
株洲市|
平乡县|
志丹县|
扬州市|
密云县|
上饶县|
方山县|
栾川县|
九龙城区|
新建县|
清镇市|
怀柔区|
梅河口市|
北流市|
宁夏|
光泽县|
炎陵县|
洛浦县|
屏东市|
维西|
华坪县|
清新县|
新化县|
来安县|
敖汉旗|
喜德县|
徐闻县|
上犹县|
香格里拉县|
吉隆县|